Department of Computer Science

Principles of Functional Languages

Fall Semester 2010

Dr. Maury Eggen

Homework Laboratory Assignment 4:

Homework laboratory assignment four involves studying sorting in Scheme. We will study the minsort, insertion sort, mergesort and quicksort algorithms. You are to do some research to find a millisecond accurate timer for some version of scheme, so you may time the actual sorting algorithm and determine the time it takes for various file sizes. Sort 100, 1000, 10000 and 100000 elements and gather timing information for each of the algorithms.

You must also research how to read an external datafile into a list, and also how to write a list to an external file.

Your homework should have the following functions:
(filetolist filename) (returning a list)
(listtofile filename) (returning no value)
(minsort ls) (returns a sorted list)
(insertionsort ls) (returns a sorted list)
(mergesort ls) (returns a sorted list)
(quicksort ls) (returns a sorted list)
(randomfile filename) (returns no value but writes a random file to disk)

Homework due date: Monday, 11 Oct 2010