Glimmer Labs

Exercise: Comparing Sorting Algorithms

Using the techniques you've developed for evaluating the running time of selection sort, compare the running times of selection sort, insertion sort, and merge sort. Which is fastest on large problems? On small? How much faster?

Note that you may have difficulty finding a quadratic function that matches the running time of merge sort. You might want to try other functions to see if you can get a better fit.

You can load an implementation of selection sort with

(load "/home/rebelsky/Web/Scheme/simple-selection-sort.ss")
That Scheme file provides the procedures

You can load an implementation of insertion sort with

(load "/home/rebelsky/Web/Scheme/simple-insertion-sort.ss")
That Scheme file provides the procedures

You can load an implementation of merge sort with

(load "/home/rebelsky/Web/Scheme/simple-merge-sort.ss")
That Scheme file provides the procedures


This document was generated by Siteweaver on Fri Sep 10 10:16:17 2004.
The source to the document was last modified on Tue Aug 20 16:44:30 2002.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Glimmer/Sorting/comparing-sorts.html.

You may wish to validate this document's HTML ; Valid CSS! ; Check with Bobby

Glimmer Labs: The Grinnell Laboratory for Interactive Multimedia Experimentation & Research
glimmer@grinnell.edu