Merge pull request #1454 from uvaishzafri/#1443

fix: Updated sorting/comb_sort.cpp
This commit is contained in:
Ayaan Khan 2021-02-12 10:00:45 +05:30 committed by GitHub
commit 521aa3f8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;