COSC 2415 - Data Structures and
ITSE 2445 Data Structures
Bob Comer, Professor of Computer Studies
Program 3 - Sorting a Linked List
Be sure to read through Chapter 5 of the textbook before starting this assignment.
Do Programming Project 7 at the end of Chapter 5 of the Main and Savitch book (pages 275-276). Start with the linked list toolkit from Chapter 5 (the code is available on the authors' web site) and add the following function to the toolkit:
void sort_list( node*& head_ptr ); // see preconditions and postconditions in textNote that your function should work for any data type that is ordered. Write a driver program to test your function for a linked list of integers. You will probably also want to write a function to print a list of the values in a linked list.
Your project should be divided into separate files - a class definition file, a class implementation file, and the client (driver) program.
Return to Data Structures homepage
Return to ACC Homepage