This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 15-121 FALL 2009 [CORTINA]LAB 4image by Una WoodruffIn this recitation, you will implement methods for a circularly singly-linked list. In this type of list, there is one reference to the head of the list. The last node of the list has a next reference that points back to the head of the list. EXERCISESDownload the CircularlyLinkedList.zipproject file. This project contains a CircularlyLinkedList class that will model a circular singly-linked list as shown above. The constructor is given for you, creating an empty circular list. There is also a private inner class to represent a node in the list. The project also includes a class ListTesterthat tests the methods that you will write. Read this file over quickly to see what tests are performed and determine what the expected output should be for each set of instructions. 1. In the CircularlyLinkedListclass, complete the addmethod that inserts the new entry into the circular list. Insert the new entry into the list so that the insert operation is always O(1), regardless the circular list....
View Full Document
- Spring '09