From 0767af4a0d20f22c9bb22e569aa9d24ea5a09f5a Mon Sep 17 00:00:00 2001 From: Panquesito7 Date: Tue, 23 Jun 2020 15:26:55 -0500 Subject: [PATCH] fix: Revert `comb_sort` changes --- sorting/comb_sort.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sorting/comb_sort.cpp b/sorting/comb_sort.cpp index ab0b456dd..1b0a4d706 100644 --- a/sorting/comb_sort.cpp +++ b/sorting/comb_sort.cpp @@ -14,7 +14,7 @@ int FindNextGap(int x) { return std::max(1, x); } -void CombSort(int b[], int l, int r) { +void CombSort(int a[], int l, int r) { // Init gap int gap = n; @@ -30,8 +30,8 @@ void CombSort(int b[], int l, int r) { // Compare all elements with current gap for (int i = l; i <= r - gap; ++i) { - if (b[i] > b[i + gap]) { - std::swap(b[i], b[i + gap]); + if (a[i] > a[i + gap]) { + std::swap(a[i], a[i + gap]); swapped = true; } }