From ede9eb44fd62e01fb061952bc892d3b52e799264 Mon Sep 17 00:00:00 2001 From: freverda <@> Date: Sat, 12 Nov 2022 17:45:42 +0100 Subject: [PATCH] s --- InsertionSort.java | 13 ++++++------- __SHELL37.java => __SHELL15.java | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) rename __SHELL37.java => __SHELL15.java (57%) diff --git a/InsertionSort.java b/InsertionSort.java index 6627f88..25682dc 100644 --- a/InsertionSort.java +++ b/InsertionSort.java @@ -24,17 +24,16 @@ public class InsertionSort } //Vergleichen und Vertauschen System.out.println("Sortierter Array:"); - for(int i = 0; i= 0 && Array[j] >Wert ){ - Array [j] = Array[j + 1]; + while(Array[j] > Wert){ + Array [j + 1] = Array[j ]; - System.out.println(Array[j+1] ); + System.out.println(Array[j] ); } - while(j>=0 && Array[j] < Wert){ - System.out.print(Array[i]); + } System.out.println(); @@ -46,7 +45,7 @@ public class InsertionSort } - } + diff --git a/__SHELL37.java b/__SHELL15.java similarity index 57% rename from __SHELL37.java rename to __SHELL15.java index 3441b2f..bd9ee30 100644 --- a/__SHELL37.java +++ b/__SHELL15.java @@ -1,5 +1,5 @@ -public class __SHELL37 extends bluej.runtime.Shell { +public class __SHELL15 extends bluej.runtime.Shell { public static void run() throws Throwable { InsertionSort.InsertionSort();