Hallo, ich musste einen Array erzeugen mit zufallszahlen bis 100 und nun soll ich die zahlen mit Bubblesort sortieren.Leider hab ich totalen Blackout (Hirnblockade) Bitte um Hilfe!!!
bitte am code sonst nichts weiteres verändern, möchte es auf diese Art irgendwie schaffen. Danke
[Java]
public class Sortieren {
private static int[] a = new int[100];
private static int Grenze = 100;
private static void erzeugeListe() {
for(int i = 0; i<Grenze-1; i++)
a = (int)(Math.random()*Grenze);
}
private static void sortierebubblesort() {
boolean unsortiert = true;
int n = Grenze-1;
}
public static void main(String[]args) {
erzeugeListe();
}
}
[/code]
bitte am code sonst nichts weiteres verändern, möchte es auf diese Art irgendwie schaffen. Danke
[Java]
public class Sortieren {
private static int[] a = new int[100];
private static int Grenze = 100;
private static void erzeugeListe() {
for(int i = 0; i<Grenze-1; i++)
a = (int)(Math.random()*Grenze);
}
private static void sortierebubblesort() {
boolean unsortiert = true;
int n = Grenze-1;
}
public static void main(String[]args) {
erzeugeListe();
}
}
[/code]
Zuletzt bearbeitet von einem Moderator: