CSCI 333 Project 6

This assignment is due Friday, 5 December, 2003 at 11:00 am.

The task

This project has some similarities to Projects 3, 4, and 5, but it doesn't build on them.

Assume that the file CSCI363.dat contains a series of records consisting of (1), an 8-byte field that contains a null-terminated string of 1 to 7 lowercase letters; (2), a 4-byte field containing a 32-bit integer. Further assume that these records are sorted by the first field.

Write a program that receives a single command-line argument. It uses the argument to search CSCI363.dat for a record with a matching string in the first field. If the program find the record it prints a message similar to:

If it does not find a matching record, it prints a message similar to:

One more requirement

Your program should use a O(log n) algorithm, such as binary search, to find the record.

To save disk space

There is a huge test file located in the directory /usr/local/csci/333/Project6 on the CSCI computers. Rather than copying this file to your directory, use the following command to create a symbolic link.

Note the dot that ends the command line! You should be able to find a key with the first seven letters of your last name in this file.

Turning in the assignment

Place your solution in a read-protected csci/333/Project6 along with a Makefile that will compile your program into the executable Project6.