EECE 330 Homework 3 Assignment, Fall 2011

American University of Beirut · Data Structures and Algorithms · 1 page

All EECE 330 files
EECE 330 Homework 3 Assignment, Fall 2011, page 1

Stuck on a question? A tutor can walk you through it.

More EECE 330 files

Show the text of this homework
EECE330 Assignment 3 You are to build a doubly linked list of the book objects that was introduced in assignment2. First you build the list by using the function InsertAtHead and then you have to run the three following functions: 1. Sort a list according to ISBN number without using any temporary lists. You can simulate the bubble sort that we use on arrays. 2. Merge an unsorted list into a sorted list according to ISBN numbers. 3. Print backwards the objects in the list Write a main program to create two unsorted doubly linked lists. Call the sort function to sort one of the lists then call the merge function which takes the two lists and insert the unsorted list into the sorted one. Finally, call the print function to check your results. A sample run would look as follows: list1 list2 list1 sorted list1 after merging list2 Print list1 999 - 777 - 666 - 555 - 444 - 333 - 222 ISBN 333 ISBN 999 ISBN 555 ISBN 777 ISBN 222 ISBN 666 ISBN 444 ISBN 333 ISBN 555 ISBN 777 ISBN 999 ISBN 222 ISBN 333 ISBN 444 ISBN 555 ISBN 666 ISBN 777 ISBN 999