mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Merge pull request #1454 from uvaishzafri/#1443
fix: Updated sorting/comb_sort.cpp
This commit is contained in:
commit
521aa3f8cf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user