Skip to main content
ICT
Lesson AB29 - Linked List
 
Main   Previous
 

LAB ASSIGNMENT AB29.3 page 18 of 18

DoublyLinkedList

Assignment:

  1. Starting with the orderedList source code from Lab Assignment AB29.2, OrderedList, modify the class definitions to implement a doubly-linked list.

  2. The requirements for this lab:

    1. Read a data file (file10.txt) from disk and build an ordered doubly-linked list.

    2. Print the list in the forward direction. Include a line number for each pair of id/inv values.

    3. Print the list in the backward direction. Include a line number for each pair of id/inv values.

    4. Delete the following values:

      57, 12500, 184, 13066, 23456, 19967, 13066

      Be aware that your algorithm must deal with attempts to delete values that are not in the list.

    5. Print the list again in the forward direction only.

  3. You might want to test your delete algorithm on a shorter file, such as (file3.txt).

Instructions:

  1. Submit your source code and a run output of the following:

    printing in the forward direction
    printing in the backward direction
    printing in the forward direction after deletion of values

 

Main   Previous
Contact
 © ICT 2006, All Rights Reserved.