Class DoublyLinkedList<Item>

java.lang.Object
dsa.lab02.solutions.DoublyLinkedList<Item>
Type Parameters:
Item - the item type
All Implemented Interfaces:
Container<Item>, DynamicSequence<Item>, LinkedList<Item>, StaticSequence<Item>, Iterable<Item>

public class DoublyLinkedList<Item> extends Object implements LinkedList<Item>
A doubly-linked list.

Nodes are directly-linked to both their predecessors and successors. Holds references to both the first and last nodes (if non-empty).

  • Constructor Details

    • DoublyLinkedList

      public DoublyLinkedList()
      Construct an empty doubly-linked list.
    • DoublyLinkedList

      public DoublyLinkedList(Iterable<Item> items)
      Construct a doubly-linked list containing the given items.
      Parameters:
      items - the items
    • DoublyLinkedList

      @SafeVarargs public DoublyLinkedList(Item... items)
      Construct a doubly-linked list containing the given items.
      Parameters:
      items - the items
  • Method Details