singly-linked-lists
v1.0.1
Published
This is a JavaScript implementation of linked lists ---
Downloads
2
Readme
A quick overview of this project
This is a JavaScript implementation of linked lists
Classes
- LinkedList class serves as a representation of the whole list
- Node class serves as a node of a list
LinkedList methods
append(value)
adds a new node containing value to the end of the listprepend(value)
adds a new node containing value to the start of the listsize
returns the total number of nodes in the listhead
returns the first node in the listtail
returns the last node in the listat(index)
returns the node at the given indexpop
removes the last element from the listcontains(value)
returns true if the passed in value is in the list and otherwise returns false.find(value)
returns the index of the node containing value, or null if not found.toString
represents LinkedList objects as strings. The format is: ( value ) -> ( value ) -> ( value ) -> null