Skip to content

Commit 3568abc

Browse files
New Commit
1 parent e7c4d87 commit 3568abc

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

quick_sort.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,6 @@ void swap(int *a, int *b){
1111
}
1212

1313
int partition(int low, int high) {
14-
/*
15-
// select the rightmost element as pivot
16-
int pivot = a[high];
17-
18-
// pointer for greater element
19-
int i = (low - 1);
20-
21-
// traverse each element of the array
22-
// compare them with the pivot
23-
for (int j = low; j < high; j++) {
24-
if (a[j] <= pivot) {
25-
26-
// if element smaller than pivot is found
27-
// swap it with the greater element pointed by i
28-
i++;
29-
30-
// swap element at i with element at j
31-
swap(&a[i], &a[j]);
32-
}
33-
}
34-
35-
// swap the pivot element with the greater element at i
36-
swap(&a[i + 1], &a[high]);
37-
38-
// return the partition point
39-
return (i + 1);*/
40-
4114
int i,j,t,flag=1,pos=low;
4215
while(flag == 1){
4316
for(i=high;i>pos;i--){

quick_sort.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)