Overview


The Goal

Now that you’re warmed up, we’re ready to begin building our sorting visualizer. Here’s an example of what it will look like when we’re finished:

The Plan

Getting this working will take some time and effort. To help make it manageable, we’ll break the project up into the following high-level steps:

  1. Create a DataSet class to contain the data we’re going to sort. At first, to keep things simple, there will be no visual component other than the text output in the terminal. Once we have some basic functionality in place we’ll come back to add the graphics.
  2. Get our text-based visualization working for Selection Sort and Insertion Sort.
  3. Add a looping menu that allows the user to choose which sort they would like to run.
  4. Create a VisualDataSet class that inherits from our DataSet class, but overrides the display method to produce a visual representation of itself using the picture module. If all goes well, substituting the VisualDataSet for the DataSet class should result in a working graphical visualization like the one shown above. At this point we’ll add a menu option to allow the user to choose between VisualDataSet and DataSet.
  5. Finally, we’ll implement Bubble Sort and add this to our menu.

The steps above will take you to the end of the required part of the lab. Once they are complete, you’ll have a program that allows the user to choose between text-based and graphical visualizations of 3 classic sorting algorithms.

Extra Credit

In keeping with CSCI 150 tradition, there are extra credit opportunities available once you’ve completed the required steps above. The various options are described in the Extra Credit page before the Wrap Up.