Project 1

CISC 320 Algorithms and Advanced Programming -- Spring, 1999

Project Goal.

Problem statement. Many sorting situations have an initial data set that is partially sorted. For example sorted data sets from each of several sources may be the input. It is natural to suppose that it would be wise to take advantage of this fact when designing an algorithm to produce a sorted combination of these data sets. For example, this is precisely the situation Foster McGeary dealt with in the ssn processing example described in class. It is also often the case that there will be several records in the input data which have the same value for the sorting key. This will be true of our data, moreover it will be important that the sort method be stable . That means that in the sorted result, the records with the same key value will be given in the same relative order they had in the input data. For example, suppose in the input data set there are 3 records with the same key value and they are in positions data[2], data[101], and data [23459]. Suppose further that there are 200 other data items with smaller key value. Then these three items should end up in positions 201, 202, and 203, with original data[2] --> data[201], data[101] --> data[202], etc.

In a nutshell, then, the problem is to produce a stable sort routine which is very efficient when the input data set consists of a few sorted sets concatenated together. The individual sorted sets are rather large. Example: there may be 10 sorted sets of about 10,000 items strung together to form a set of 100,000 items to sort.

Details

Deliverables and Due date Sort competition day is Thursday, Mar 18. Due on that day are printouts of the code and written summary explaining your approach and reporting your time on 320dir/sortData.large.