Returns the head's value of the list if the list is not empty or returns undefined
Returns the length of the list
Returns the tail's value of the list if the list is not empty or returns undefined
Delete the node after the given target value and return its value
The value to be searched for in the list to delete the node after it
Delete the node at the given index and return its value
The index of the node to be deleted
Delete the node before the given target value and return its value
The value to be searched for in the list to delete the node before it
Delete the last node from the list and return its value
delete the first node from the list and return its value
Delete the node containing the given value and return its value
The value to be searched for in the list to delete the node containing it
Display the list in normal order or reverse order
The mode to display the list in, either
n
for normal (optional) or
r
for reverse
Traverse the list and apply the given function to each node in normal order or reverse order
The mode to traverse the list in, either
n
for normal (optional) or
r
for reverse
Insert the given value after the given target value, throws an error if the target value is not found
The value to be searched for in the list to insert the value after it
The value to be inserted after the target value
Insert the given value at the end of the list
Value to be inserted at the end of the list
Insert the given value at the given index, throws an error if the index is out of bounds
index at which the value should be inserted
value to be inserted at the given index
Insert the given value at the start of the list
value to be inserted at the start of the list
Insert the given value before the given target value, throws an error if the target value is not found
The value to be searched for in the list to insert the value before it
The value to be inserted before the target value
Reverse the list, this mutates the list
Get the list in a JS array in normal order or in reverse order
The mode to get the list in, either
n
for normal (optional) or
r
for reverse
Returns a instance of DoublyLinkedList with the values in the given list
array of values to create the list from
Generated using TypeDoc, the 1/4/2022 at 10:37:56 PM
Functionality is the same for the most part (there are two more methods in this class) as
SinglyLinkedList
for the end users but implemented with nodes that has references to both next and previous node, inherits from LinkedList