Skip to content

Commit e2bba66

Browse files
committed
bubble sort & insertion sort 100 done
1 parent 5d0b09f commit e2bba66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SortingAlgorithm.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ public Void doInBackground() throws InterruptedException {
8686
for(traversing_index = 1; traversing_index < (SIZE - current_index); traversing_index++) {
8787
if(bar_height[traversing_index - 1] > bar_height[traversing_index]) {
8888
swap(traversing_index, traversing_index - 1);
89+
traversing_index--; // just for annimation
8990

90-
Thread.sleep(1);
91-
repaint();
91+
Thread.sleep(1); // controls the speed
92+
repaint(); //
9293
}
9394
}
9495
}

0 commit comments

Comments
 (0)