Upgrade 12.11.
parent
873b41722c
commit
b39587b4d5
|
@ -23,15 +23,26 @@ public class InsertionSort
|
|||
System.out.println(+Array[i]);
|
||||
}
|
||||
//Vergleichen und Vertauschen
|
||||
System.out.println("Sortierter Array:");
|
||||
for(int i = 0; i<Array.length; i++){
|
||||
for(int j = i+1; j<Array.length; j++){
|
||||
int ArrayToSort = Array[i];
|
||||
int j = i;
|
||||
while(ArrayToSort < Array[j+1]){
|
||||
Array[j] = Array[j-1];
|
||||
}
|
||||
Array[j] = ArrayToSort;
|
||||
System.out.println(ArrayToSort);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
public class __SHELL11 extends bluej.runtime.Shell {
|
||||
public static void run() throws Throwable {
|
||||
|
||||
InsertionSort.InsertionSort();
|
||||
|
||||
}}
|
Loading…
Reference in New Issue