Quick sort with middle element as pivot
My understanding of quick sort is Choose a pivot element (in this case I am choosing middle element as pivot) Initialize left and right pointers at extremes. Find the first element to the left of the pivot which is greater than pivot. Similarly find the first element to the right of the pivot which is smaller than pivot Swap elements found in 3 and 4. Repeat 3,4,5 unless left >= right. Repeat the whole thing for left and right subarray as pivot is now placed at its place. I am sure I am missing something here and being very stupid. But above does not seems to be working fot this array: 8,7,1,2