CircularLinkedList

CircularLinkedList

Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.

Constructor

new CircularLinkedList()

Source:

Methods

append(element) → {CircularLinkedList}

Append new element to the end of the list
Source:
Parameters:
Name Type Description
element LinkedListElement new element to be appended
Returns:
Type:
CircularLinkedList

insert(newElement, elementBefore) → {CircularLinkedList}

Insert new element to the list after elementBefore
Source:
Parameters:
Name Type Description
newElement LinkedListElement new element to be inserted
elementBefore LinkedListElement element in the list to insert after it
Returns:
Type:
CircularLinkedList

remove(element) → {CircularLinkedList}

Remove element from the list
Source:
Parameters:
Name Type Description
element LinkedListElement element to be removed from the list
Returns:
Type:
CircularLinkedList