It is a javascript library which contains almost all the data structures and algorithms.
npm install ds-structures
List Examples
`
$3
const list = new List(1,2,3,4,'a','b','c')
create a list of [1,2,3,4,a,b,c]
$3
list.get(); //Returs the list;
get element at particular index
list.get(index) // returns element at particular index;
$3
list.push(value) // pushes the value to your list and returns the list
$3
list.pushFront(value) // adds the value at the 0 index of the list
$3
list.contains(value) // returns true if value is present in the list or returns false
$3
list.popEnd(); // removes the last element of the list and returns the rest of the list;
$3
list.popFront() // removes the element at the 0 index and returns the rest of the list;
$3
list.remove(element) // this will remove the first occurance of element from the list and returns the rest of the list, element should be the value not the index;
$3
list.splice(index) // removes the element at the given index and returns the rest of the list
$3
list.removeDuplicates(); // returns the unique list of elements
$3
filter based on mode -> two modes are there i.e (number and string ) mode
filter all the numbers from the list
list.filter('number') // filters all the numbers and returns the list without number , it may contain characters
filter all the strings from the list
list.filter('string') // returns all the numbers;
filter an element
list.filter(element) // returns the list without containing this element
filter and list of elements
list.filter(new List('a',1,'b')) // returns the list without containing the new filter list
push element at particular index
list.pushAt(element,index) // pushes the given element at the given index , if index is not present pushFront is called
fill the array
list.fill(element,topIndex,bottomIndex) // fills the array with the given element from bottomIndex till topIndex, bottomIndex default is 0
`
`
Getting Started With Stack
$3
#### const {Stack} = require('ds-structures');
`
Stack Examples
`
$3
#### const stack = new Stack(size_of_stack);
$3
stack.push(element) // returns the updated stack
$3
stack.pop(element) // returns the updated stack
$3
stack.peek() // returns peek element from the stack
$3
stack.stackOverFlow() // returns true if the stack is full else false
$3
stack.stackUnderFlow() // returns true if stack is empty else false;
$3
stack.extend(your_new_stack_size)
`
`
Getting Started With Queue
const {Queue} = require('ds-structures');
const queue = new Queue();
$3
queue.enqueue(item) // pushes item to the end of the queue
$3
queue.dequeue(); // removes the first item from the queue;
$3
queue.first // returns the front element from queue
$3
queue.last // returns the last element of the queue
$3
queue.size // returns the size of queue
`
Linked List Examples
``