Question
need added functions where the comments ask for them please (java) public class LinkedList { private class Node { private T data; private Node link;
need added functions where the comments ask for them please (java)
public class LinkedList
public Node( ) { data = null; link = null; }
public Node(T newData, Node
private Node
public LinkedList( ) { head = tail = null; }
// Adds a node at the start of the list with the specified data. // The added node will be the first node in the list. public void addFront(T itemData) { }
// Removes the head node and returns true if the // list contains at least one node. Returns false if the list is empty. public boolean deleteFront( ) { }
// Analogous to addFront, but add at back. public void addBack(T itemData) { }
// Analogous to deleteFront, but delete at back. public boolean deleteBack( ) { }
// Returns the number of nodes in the list. public int size( ) { }
// Finds the first node containing the target item, and returns a // reference to that node. If target is not in the list, // null is returned. private Node
// Checks whether list contains item. Must call the private find method. public boolean contains(T item) { }
public void outputList( ) { }
public boolean isEmpty( ) { }
public void makeEmpty( ) { }
// For two lists to be equal they must contain the same data items in //the same order. The equals method of T is used to compare data items. public boolean equals(Object otherObject) { if (otherObject == null) return false; else if (getClass( ) != otherObject.getClass( )) return false; else { LinkedList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started