net.datastructures
Class Node<E>
java.lang.Object
net.datastructures.Node<E>
public class Node<E>
- extends java.lang.Object
Node of a singly linked list, which stores references to its element and to
the next node in the list.
- Author:
- Natasha Gelfand, Roberto Tamassia, Michael Goodrich
Constructor Summary |
Node()
Creates a node with null references to its element and next node. |
Node(E e,
Node<E> n)
Creates a node with the given element and next node. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Node
public Node()
- Creates a node with null references to its element and next node.
Node
public Node(E e,
Node<E> n)
- Creates a node with the given element and next node.
getElement
public E getElement()
getNext
public Node<E> getNext()
setElement
public void setElement(E newElem)
setNext
public void setNext(Node<E> newNext)