question about Quick Sort
I'm sure you all are familiar with the quick sort algoritem, but I'm still gonna post it in short:
In the partition function, the norm is to usually pick the first number in the array as the pivot, right? But if you choose the last one as the pivot, the loop can become endless. How does that happen?
IF left < right THEN
pivot := partition (list, left, right);
Quicksort (list, left, pivot-1);
Quicksort (list, pivot + 1, right);
Thanks in advance