Skip to content

Commit

Permalink
InsertSort 第一层循环结束条件修改
Browse files Browse the repository at this point in the history
  • Loading branch information
huihut committed May 20, 2019
1 parent 887e445 commit 3d7ce08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Algorithm/InsertSort.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
void InsertSort(vector<int>& v)
{
int len = v.size();
for (int i = 1; i < len - 1; ++i) {
for (int i = 1; i < len; ++i) {
int temp = v[i];
for(int j = i - 1; j >= 0; --j)
{
Expand All @@ -30,4 +30,3 @@ void InsertSort(vector<int>& v)
}
}
}

0 comments on commit 3d7ce08

Please sign in to comment.