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