Skip to content

Commit 3d7ce08

Browse files
committedMay 20, 2019
InsertSort 第一层循环结束条件修改
#12 (comment)
1 parent 887e445 commit 3d7ce08

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎Algorithm/InsertSort.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
void InsertSort(vector<int>& v)
1717
{
1818
int len = v.size();
19-
for (int i = 1; i < len - 1; ++i) {
19+
for (int i = 1; i < len; ++i) {
2020
int temp = v[i];
2121
for(int j = i - 1; j >= 0; --j)
2222
{
@@ -30,4 +30,3 @@ void InsertSort(vector<int>& v)
3030
}
3131
}
3232
}
33-

0 commit comments

Comments
 (0)
Please sign in to comment.