Project 7: Merge sort on lists

The goal of this assignment is to practice writing algorithms on linked lists.

1. Introduction

In this project you will write one more sorting algorithm for lists: merge sort. Refer again to project 3 to review how merge sort works in general.

2. Setup

Copy the files from the subdirectory for this project. These files are a revision of the ones you used in lab 12.

cp /homeemp/tvandrun/pub/235/proj7/* .

3. Merge sort

As in the lab, the driver and a big part of the list class is already provided for you. Also, the basic merge sort algorithm is given for you in the method sort() in class ListMerge.

Your task is to write the following methods that sort() needs:

It is possible that you will write merge in such a way that you wish List to have some extra operations; feel free to add more operations to List as you see fit.

4. Turn in

Do the normal turn-in procedure: Script file, cat the files you changed, compile, run a few times.

 > a2ps -P sp (the name of the script file)

Then turn in the hard copy by 5:00, Tue, Apr 3.


Thomas VanDrunen
Last modified: Mon Jul 23 14:41:28 CDT 2007