Sorting Laboratory

 

Sorting Laboratory Main Applet

This links to an applet that allows the user to select a sorting algorithm,

a type of data distribution, and a sample size, and displays the number of

compares and swaps that were needed to run one instance of the selected

algorithm and parameters.

 

Sorting Laboratory Worksheet (html document)

Sorting Laboratory Worksheet (Word version)

Make a hard copy of the worksheet, and use it to record data from repeated

selections of the options presented by the main sorting applet. The worksheet

has tables for recording data and observations formed after examining the

data.

 

Descriptions and code for each of the sorting algorithms contained in this laboratory

 

Selection Sort

Insertion Sort

Bubble Sort

Recursive Merge Sort

Quicksort

Quicksort (Alternate version)

 

Applet displaying the best-fitting curve to data

 

A regression analysis is performed on the data collected running five trials

each for ten different sample sizes of distinct random integers. The average

number of compares for the five trials is determined for each of the ten sample

sizes and used to fit the best quadratic or n lg(n) curve to the data.

 

Links to other sites displaying animations of sorting algorithms

 

Sorting Annimations (from C. Wellington, Shippensburg Univ.)