This algorithm sorts in ascending order - i.e., smaller
elements move to the front of the list.
Instructions on use of the applet
The user of the applet is advised to read this section in order to make the
best use of the applet. If you have a large enough browser window, this page
should be scrolled so that the
applet itself (including the interaction panel at the bottom of the display
part of the applet) is visible along with these instructions. The buttons in
the interaction panel are to be used in the following manner:
- The "Step" button will perform the next step of the sort, and then the
applet operation will pause for further interaction input (i.e., button click).
- The "Slow" button will perform the sort algorithm, with a fairly long pause
between two consecutive steps.
- The ">>" button will perform the sort algorithm, with minimal pause
between two consecutive steps.
- The "Back" button will undo the last peformed step of the sorting
algorithm, and pause for further interaction. Thus, subsequent clicks on
"Back" will undo the sort performed so far, step by step.
- The "<<" button undoes till the list is back in its first,
completely unsorted, state.
- The "Reset" button takes the sort back to the first, completely unsorted,
state in one step, so the user may restart.
- The "Delay" Bar must be used only in "Slow" mode. Moving the bar to
the left decreases the delay (resulting in faster execution), similarly
moving the bar to the right increases the delay.
- The "stop" button terminates the operation of the applet (Note:
it cannot be restarted after being stopped).
Applet
NOTE : Clicking on the ">>" or "<<" buttons will move the sort forward
(or backward) at a VERY FAST pace, which may be unobservable. These
are essentially "Fast Forward" or "Rewind" buttons. If you want to see the
sort move ahead at a reasonable pace, click on the "Slow" button and then
use the slider bar to adjust the delay to a suitable value.
Heap Sort Animation with User Input