Results 1 to 3 of 3
Thread: DoublyLinkedList
- 07-13-2011, 03:09 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 78
- Rep Power
- 0
DoublyLinkedList
I have an assignment to implement a Dequeue as doublyLinkedList (with methods insert left, and delete right) without a header, and not as a circular linked list
Here is what I have, seems to simple though:
Java Code:public class Dequeue { DoublyLinkedList dll; public Dequeue(){ dll = new DoublyLinkedList(); } public void insertLeft(Object o){ dll.insertFirst(o); } public void deleteLeft(){ dll.deleteFirst(); } public void insertRight(Object o){ dll.insertLast(o); } public void deleteRight(){ dll.deleteLast(); } }
- 07-13-2011, 03:28 AM #2
Did you write the DoublyLinkedList class yourself?
Does the DoublyLinkedList class have any error checking? If not you will have to add it to your Dequeue class. By error checking I mean what happens when you call deleteLeft on an empty List?
- 07-13-2011, 03:29 AM #3


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks