package paket;
public class Quickdort1 {
public static void main(String[] args) {
int[] liste = { 0, 9, 4, 6, 2, 8, 5, 1, 10 };
System.out.println("Vor dem sortieren: ");
for (int i = 0; i < liste.length; i++) {
System.out.print(liste[i] + " ");
}
teilen(liste, 0, liste.length - 1);
System.out.println("Nach dem sortieren: ");
for (int i = 0; i < liste.length; i++)
System.out.print(liste[i] + " ");
}
public static int teilen(int list[], int links, int rechts) {
int i = links;
int j = rechts - 1;
int pivot = list[rechts];
int t = 0;
int p = 0;
while (true) {
while (list[i] <= pivot && i < rechts) {
i = i + 1;
}
while (list[j] >= pivot && j > links) {
j = j - 1;
}
if (i > j) {
t = list[i];
list[i] = list[j];
list[j] = t;
}
while (i < j) {
if (list[i] > pivot) {
p = list[i];
list[i] = list[rechts];
list[rechts] = p;
}
}
}
}
}
<Vielleicht hilft das weiter...
ich bekomme hier nur vor dem sortieren raus, nach dem sortieren wird einfach nicht mehr angezeigt