[Skip Links]
Sorting:
[Front Door]
[Syllabus]
[Standard Sorting Algorithms]
[Lab Manual (PDF)]
Exercises:
[PBJ]
[PBJ2]
[Sorting CDs]
[Sorting Numbers]
[Starting Scheme]
[Comparing Algorithms]
[Selection Sort]
[Formalizing Requirements]
[Comparing Sorts]
[Finding the Largest]
Glimmer/Education:
[Glimmer Labs]
[SchemeWeb]
[ScriptFu For Schemers]
[CS Education]
Glimmer Labs
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
(selection-sort lst)
(smallest lst)
(remove val lst)
You can load an implementation of insertion sort with
(load "/home/rebelsky/Web/Scheme/simple-insertion-sort.ss")That Scheme file provides the procedures
(insertion-sort list)
(insert val lst)
You can load an implementation of merge sort with
(load "/home/rebelsky/Web/Scheme/simple-merge-sort.ss")That Scheme file provides the procedures
(merge-sort lst)
(merge slst1 slst2)
(split lst)
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
;
;
Check with Bobby