提交 305dae10 编写于 作者: K Kevin Xu

fix isSorted

上级 d90c2753
......@@ -95,7 +95,7 @@ public class Bubble<T extends Comparable<T>> extends Sort<T> {
int N = nums.length;
boolean isSorted = false;
for (int i = N - 1; i > 0 && !isSorted; i--) {
hasSorted = true;
isSorted = true;
for (int j = 0; j < i; j++) {
if (less(nums[j + 1], nums[j])) {
isSorted = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册