Skip to content

Commit

Permalink
Update insertion.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rwqwr authored Oct 7, 2022
1 parent 32486ce commit 63637a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/russian/cs/sorting/insertion.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ weight: 3
```cpp
void insertion_sort(int *a, int n) {
for (int k = 1; k < n; k++)
for (int i = k; i > 0 && a[i - 1] < a[i]; i--)
for (int i = k; i > 0 && a[i - 1] > a[i]; i--)
// мы ещё не дошли до начала массива и предыдущий элемент меньше
swap(a[i], a[i - 1]);
}
Expand Down

0 comments on commit 63637a6

Please sign in to comment.