Homework 8: Animated Sorting Algorithms

Starter Files

For this assignment, create a package named sorters and place these files in that package:

Implementing the Sorting Algorithms

The Bubble Sort and Insertion Sort algorithms have been provided for you, to demonstrate how to use the Sorter class in this project. Implement the following classes, each of which extends Sorter: Note that each of BubbleSorter.java and InsertionSorter.java contain one-line main() methods for testing without the use of the GUI. Be sure to test your other four implementations in a similar manner.

Implementing the Animation Thread

There will be three total threads running within AnimatedSorting:

  1. The main GUI thread.
  2. A thread in which sorting occurs.
  3. A thread that takes the incremental results from sorting and animates them.
It is your task to implement the last of these three in the AnimationThread class. The strategy is as follows: