Heapsort Proficiency Exercise Help Page
Main action
This exercise asks you to show the steps that would be taken by heapsort. Initially you are presented with a maxheap, and you must make the steps that Heapsort would take on this input. The things that you can do are:
- Swap two elements in the heap. You do this by first clicking on one element (which will make the text appear larger to mark it for you), and then on a second element (to cause the actual swap to take place. Remember that both the array and the tree that you see are alternate views of the heap object. So, you may click on an element either in the in the tree or the array (either is fine), and the swap will display in both.
- Decrement the heap size. This is done simply by clicking the "Decrement heap size" button. The visual effect will be to shade the last active node of the heap/last active cell of the array, which is meant to indicate that this node/cell are no longer part of the active part of the heap.
If you make a mistake somewhere along the line, then your mistake will be corrected for you, and you will lose that point. To get credit for the exercise, you need to get a certain percentage the total points correct (typically this is set to 90% of the possible points).
Other Controls
- If you want to restart the exercise, click the "Reset" button.
- If you want to see the correct answer, click the "Model Answer" button to see a slideshow in a pop-up window.
- Note: Viewing the answer will prevent you from obtaining credit for the current problem instance. So just hit "reset" when you are done viewing the model answer.
- The button with gears on it will let you set some options such as the animation speed (for the slideshow model answer).
- The "About" button will tell you about who wrote this, etc.
- The "Help" button got you here.