QuickSort: converting recursion to iteration
CS361: Advanced Data Structures and Algorithms
Algorithm Animation
August 1999
Quick instructions:
-
when the animation window appears, select desired operations from the Algorithm
menu. In this case, you will probably want to start by generating an array, then viewing one or more of the algorithms.
-
When execution pauses inside of an algorithm, press the continue
button to resume.
Things to Try:
- Generate a random array and then sort it.
- Sort using both the recursive and iterative forms. Note how the are almost identical in their treatment of the array.
- What is the one thing that is different about their treatment of the array?
- If you are comfortable with the way that the pivot algorithm works, you can skip right over it. If not, you can request that the animation pause inside the pivot algorithm so you can watch it at work.
Email me at zeil@cs.odu.edu
This animation was prepared using the AlgAE animation framework.
AlgAE applets run under Microsoft
Internet Explorer 4.0 (or later) and Netscape
Communicator 4.05 (or later).