repush some changes

This commit is contained in:
2023-07-07 21:27:26 -07:00
parent b2074c0351
commit 8ced1b12fc
2 changed files with 24 additions and 24 deletions

6
c/qs.c
View File

@@ -5,9 +5,9 @@
// of it and everything greater than it on the right
int partition(int arr[], int lo, int hi) {
int pivot_value = arr[hi];
int idx = -1; // this will keep track of current location of values less then the pivot
int idx = lo - 1; // this will keep track of current location of values less then the pivot
for (int i = 0; i < hi; i++) {
for (int i = lo; i < hi; i++) {
if (arr[i] <= pivot_value) {
idx++;
@@ -46,4 +46,4 @@ int main() {
printf("%d ", arr[i]);
}
printf("]\n");
}
}