Skip to content
Take that, professor!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
jsdoc2md
test
.gitignore
LICENSE
README.md
index.js
linked-list.js
node.js
package-lock.json
package.json

README.md

linked-list

An implementation of the linked list data structure in JavaScript.

Running tests

npm install
npm test

The tests are written with Mocha using Chai as an assertion library.

License

WTFPL

API Reference

LinkedList

Kind: global class

new LinkedList()

A linked list data structure.

linkedList.length() ⇒ number

Get the length of the list.

Kind: instance method of LinkedList

linkedList.add(index) ⇒ void

Add a value to the list at the specified index.

Kind: instance method of LinkedList

Param Type
index number

linkedList.dump() ⇒ Array.<*>

Returns an array containing the elements of the list.

Kind: instance method of LinkedList

linkedList.get(index) ⇒ Node

Get the value at the specified index.

Kind: instance method of LinkedList

Param Type
index number

linkedList.removeAt(index)

Remove the value from the given index.

Kind: instance method of LinkedList

Param Type
index number

linkedList.removeLast()

Remove the last value from the list.

Kind: instance method of LinkedList

linkedList.removeFirst()

Remove the first value from the list.

Kind: instance method of LinkedList

You can’t perform that action at this time.