DoublyLinkedList<T> class
Complexity of each operation
operation | complexity peekFirst | O(1) peekLast | O(1) isEmpty | O(1) isNotEmpty | O(1) length | O(1) getAll | O(n) addFirst | O(1) addLast | O(1) removeFirst | O(1) removeLast | O(1) clear | O(1) Implementation of Doubly LinkedList
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns true if there are no nodes in this list.
no setter
- isNotEmpty → bool
-
Returns true if there is at least one node in this list.
no setter
- length → int
-
Returns the number of nodes in this list.
no setter
- peekFirst → T?
-
Returns the first node data.
no setter
- peekLast → T?
-
Returns the last node data.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addFirst(
T obj) → void - Adds a node to the beginning of the list.
-
addLast(
T obj) → void - Adds a node to the end of the list.
-
clear(
) → void -
getAll(
) → List< T?> ? - Gets all nodes data in this LinkedList and then returns them as type List. This method returns null if the list is empty.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFirst(
) → T? - Removes and returns the first node data from this list. This method returns null if the list is empty.
-
removeLast(
) → T? - Removes and returns the last node data from this list. This method returns null if the list is empty.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited