Quicksort: Iterative or Recursive
问题 I learnt about quick sort and how it can be implemented in both Recursive and Iterative method. In Iterative method: Push the range (0...n) into the stack Partition the given array with a pivot Pop the top element. Push the partitions (index range) onto a stack if the range has more than one element Do the above 3 steps, till the stack is empty And the recursive version is the normal one defined in wiki. I learnt that recursive algorithms are always slower than their iterative counterpart. So