Upgrade 10.11.
parent
ede9eb44fd
commit
7b8d43ec65
|
@ -24,13 +24,14 @@ public class InsertionSort
|
||||||
}
|
}
|
||||||
//Vergleichen und Vertauschen
|
//Vergleichen und Vertauschen
|
||||||
System.out.println("Sortierter Array:");
|
System.out.println("Sortierter Array:");
|
||||||
for(int i = 1; i<Array.length; i++){
|
for(int i = 0; i<Array.length; i++){
|
||||||
int Wert = Array[i];
|
int Wert = Array[i];
|
||||||
int j = i -1 ;
|
int j = i -1 ;
|
||||||
while(Array[j] > Wert){
|
while(Array[j] > Wert){
|
||||||
Array [j + 1] = Array[j ];
|
Array [j ] = Array[j + 1 ];
|
||||||
|
Array[i] = Array[i -1];
|
||||||
|
|
||||||
|
|
||||||
System.out.println(Array[j] );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
|
|
||||||
public class __SHELL15 extends bluej.runtime.Shell {
|
|
||||||
public static void run() throws Throwable {
|
|
||||||
|
|
||||||
InsertionSort.InsertionSort();
|
|
||||||
|
|
||||||
}}
|
|
Loading…
Reference in New Issue