Singly Linked List data structure for Javascript
npm install dc-singly-linked-list SinglyLinkedList
constructor
✓ should create a linked list from an array
#insert()
✓ should add a node to the list
#getNode()
✓ should get the node with the indicated value
#getIndexOfData(data)
✓ should get the index of the node with matching data
#getNodeAtIndex()
✓ should get the node at the indicated index
#getIndexOfData()
✓ should get the node at the indicated index
#deleteAtIndex()
✓ should delete the node with the indicated index
#delete(data)
✓ should delete the node with the indicated index
#getLastNode()
✓ should return the last node in the list
#getIndexOfNode()
✓ should get the index of the specified node
list.isCircular
✓ should return true if theres a cyclical dependency
list.size
✓ should return number of nodes in the list
list.length
✓ should return number of indexes in the list
list.adjacencyList
✓ should return an array representation of the list