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 b8c5e86

Browse files
AnHongpenghustcc
AnHongpeng
authored andcommitted
fix bubbleSort.md (hustcc#9)
1 parent 2032ebd commit b8c5e86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎1.bubbleSort.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
```js
3737
function bubbleSort(arr) {
3838
var len = arr.length;
39-
for (var i = 0; i < len; i++) {
39+
for (var i = 0; i < len-1; i++) {
4040
for (var j = 0; j < len - 1 - i; j++) {
4141
if (arr[j] > arr[j+1]) { // 相邻元素两两对比
4242
var temp = arr[j+1]; // 元素交换

0 commit comments

Comments
(0)

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