Shellsort Proficiency Exercise Help Page
This exercise asks you to reproduce the actions taken by the Shellsort algorithm on a random array. Initially, you are given the array and a set of increments to use. The things that you can do are: click on the array cells to highlight those that you want to say make up the current sublist; click on array cells to swap them when you are sorting the sublist; and click on the three buttons at the bottom to advance the exercise to the next step.
For each increment, you will alternate between picking sublists and sorting sublists.
Pick a sublist
The first thing you need to do is pick out the first sublist. You pick the sublist by clicking on array cells. Clicking on an array cell toggles the highlighting. The cells that you should select are determined by the current increment size, and which sublist you are working on. When you are done picking the current sublist, click the "Done Selecting" button.
Sort the sublist
Now that you have defined a sublist, you must sort it. You can swap elements in the sublist (the ones highlighted in yellow) by clicking on them. Once you have the sublist in sorted order, click the "Done Sorting Sublist" button.
Repeat as needed
For the given increment, you will likely need to select and then sort several sublists. Once you have selected and then sorted all of the sublists for this increment, you should click "Done Increment" to start on the next increment. Once you have done all four increments, you are done. You can then look at your score by clicking the "grade" button.
Other controls
- If you want to restart the exercise, click the "Reset" button.
- If you want to back up a step and try again, click the "Undo" 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) and whether the array looks like cells or bars.
- The "About" button will tell you about who wrote this, etc.
- The "Help" button got you here.