CS1027b Computer Science Fundamentals II

Lab 8

Learning Outcomes

Upon completion of this lab, you should be able to do the following:

General Lab Instructions

IMPORTANT. Make sure you attend the lab session to which you registered, show the result(s) of each exercise to your TA, and submit the .java files that you wrote and AnswersLab8.txt through OWL by 11:55pm on the same day as your lab session to get your marks for the lab.

Exercise 1: Removing a node from a singly linked list

Exercise 2: Completing the DoublyLinkedStack class

Exercise 3: Adding a node to a doubly linked list

Download AddDoublyLinkedList.java and complete method addAtRear that adds a node to the rear of a doubly linked list whose first node is referenced by front and whose last node is referenced by rear.

Then run AddDoubleLinkedList, it must print twice the 5 values stored in the doubly linked list: The first time the values are printed in order and the second time the are printed in reverse order.