Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 593 Bytes

README.md

File metadata and controls

28 lines (16 loc) · 593 Bytes

my-linked-list-js

My personal implementation of a singly linked list in Javascript from scratch

Includes a test suite.

Functions

addToHead(data)

Adds a Node to the head. If no data is given it returns null

addToTail(data)

Adds a Node to the tail.

removeFromHead()

If there is a Node at the head it removes it.

remove(data)

Finds and removes the Node from the list if it exists.

find(data)

Finds and returns the Node that contains the data.

addAtIndex(data, index)

Adds a node at the specified index.