diff --git a/c/quick_sort.c b/c/quick_sort.c index a79deb52e..d1d51df6a 100644 --- a/c/quick_sort.c +++ b/c/quick_sort.c @@ -20,7 +20,7 @@ int partition (int arr[], int low, int high) int pivot = arr[high]; // pivot int i = (low - 1); // Index of smaller element - for (int j = low; j <= high- 1; j++) + for (int j = low; j < high; j++) { // If current element is smaller than or // equal to pivot