Skip to content

Commit

Permalink
Updated comb_sort.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
uvaishzafri committed Feb 11, 2021
1 parent 9074443 commit 97896f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sorting/comb_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void CombSort(int *arr, int l, int r) {
swapped = false;

/// Compare all elements with current gap
for (int i = l; i <= r - gap; ++i) {
for (int i = l; i < r - gap; ++i) {
if (arr[i] > arr[i + gap]) {
std::swap(arr[i], arr[i + gap]);
swapped = true;
Expand Down

0 comments on commit 97896f8

Please sign in to comment.