Skip to content

Commit 35f6a3a

Browse files
author
wangzheng
committed
fix bug.
1 parent 80550d6 commit 35f6a3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/11_sorts/Sorts.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public class Sorts {
1111
public static void bubbleSort(int[] a, int n) {
1212
if (n <= 1) return;
1313

14-
// 提前退出标志位
15-
boolean flag = false;
1614
for (int i = 0; i < n; ++i) {
15+
// 提前退出标志位
16+
boolean flag = false;
1717
for (int j = 0; j < n - i - 1; ++j) {
1818
if (a[j] > a[j+1]) { // 交换
1919
int tmp = a[j];

0 commit comments

Comments
 (0)