all-structures v1.0.2
structures
A node based basic data structures library with type safety. Following data structures are currently supported.
How to use
For example to create a LinkedList, use the following snippet:
ArrayList
An array list is a simple list data structure with an array implementation underneath. While creating an array list, following options are supported:
Supported Functions
add()
list.add("Hello")
remove()
list.remove(0);
size()
list.size();
toString()
list.toString();
get()
list.get(0);
LinkedList
A Linked list is a Singly LinkedList implementation While creating a linked list, following options are supported:
Supported Functions
add()
list.add("Hello")
remove()
list.remove(0);
size()
list.size();
toString()
list.toString();
get()
list.get(0);
next() - gets the next node. Returns undefined if reached to end.
list.next();
DoublyLinkedList
A doubly linked list can be traversed in both directions. While creating a doubly linked list, following options are supported:
Supported Functions
add()
list.add("Hello")
remove()
list.remove(0);
size()
list.size();
toString()
list.toString();
get()
list.get(0);
next() - gets the next node. Returns undefined if reached to end.
list.next();
prev() - gets the previous node. Returns undefined if reached to start.
list.prev();
Running Tests
Install dependencies
Run the mocha test cases