Class SinglyLinkedList.Node<Item>

java.lang.Object
dsa.lab02.exercises.SinglyLinkedList.Node<Item>
Type Parameters:
Item - the item type
All Implemented Interfaces:
LinkedNode<Item>
Enclosing class:
SinglyLinkedList<Item>

public static class SinglyLinkedList.Node<Item> extends Object implements LinkedNode<Item>
A node in a singly-linked list.

Only holds a direct link to the next node.

  • Constructor Details

    • Node

      public Node(SinglyLinkedList<Item> list, Item item)
      Construct a node with the given item.
      Parameters:
      list - the containing linked list
      item - the contained item
    • Node

      public Node(SinglyLinkedList<Item> list, Item item, SinglyLinkedList.Node<Item> next)
      Construct a node with the given item and successor.
      Parameters:
      list - the containing linked list
      item - the contained item
      next - the next node
  • Method Details