Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

class EmptyListE extends Exception{} public class DoublyLinkedList { private NodeDL head; private NodeDL tail; private int size; // TODO: default constructor public DoublyLinkedList(){ } //

class EmptyListE extends Exception{} public class DoublyLinkedList { private NodeDL head; private NodeDL tail; private int size; // TODO: default constructor public DoublyLinkedList(){ } // TODO: secondary constructor public DoublyLinkedList(NodeDL head, NodeDL tail){ } public int size() { return this.size; } // TODO: Insert elem at the start of the DoublyLinkedList void insertAtHead(E elem){ } // TODO: Insert elem at the end of the DoublyLinkedList void insertAtTail(E elem){ } // TODO: Delete the element from the start of the DoublyLinkedList. Throw an EmptyListE if there's nothing to delete E deleteAtHead() throws EmptyListE{ return null; } // TODO: Delete the element from the end of the DoublyLinkedList. Throw an EmptyListE if there's nothing to delete E deleteAtTail() throws EmptyListE{ return null; } // TODO: Get the element at some position. If it's not possible, throw an IndexOutOfBoundsException E get (int index) throws IndexOutOfBoundsException{ return null; } // TODO: Search the DoublyLinkedList for elem. If not found, return -1; public int search(E elem){ return -1; } // TODO: When passed some object, return true if it's a DoublyLinkedList, has the same elements in the same order. public boolean equals(Object o){ return false; } public String toString(){ String ret = ""; NodeDL temp = head; for(int i = 0; i < size; i++){ ret += temp.data + " "; temp = temp.next; } return ret; } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

Give the primary purpose of job evaluation.

Answered: 1 week ago

Question

1.who the father of Ayurveda? 2. Who the father of taxonomy?

Answered: 1 week ago

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago