As we saw in Section , recursion is usually implemented using a stack; parameters, local variables, and return addresses are pushed onto the stack when a recursive subprogram is called, and values are popped from the stack upon return from the subprogram.
Generally, we can transform a recursive subprogram into a no recursive one by maintaining such a stack within the subprogram itself.
Use this approach to design a no recursive version of function qui case rt0; use a stack to store the first and last positions of the subsists that arise in quicksort.