Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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‎

Lines changed: 3 additions & 2 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /