I implemented several algorithms and data-structures using javascript. To use them in your app, just download and import the needed .js file.
Given a string, count the number of vowels on it. vowelsCounter("Any String")
;
Given a string, returns if its palindrome or not. palindrome("Any String")
Returns the nth number inside Fibonacci sequence. fibonacci(5)
Substitute each character by shifting it up or down the alphabet by a given integer. caesarCipher("Any String", 5)
Javascript implementation of trees.
const tree = new Tree();
tree.root = new Node(1);
tree.root.add(2);
Javascript implementation of Linked Lists.
let list = new LinkedList();
list.insertHead(1);
list.insertAt(1, 2);
list.removeAt(2);
list.removeTail();
list.insertTail(40);
Javascript implementation of Stackks.
let stack = new Stack();
stack.size();
stack.push(1);
stack.peek();
stack.pop();
Javascript implementation of Queues
let queue = new Queue();
queue.enqueue(4);
queue.size();
queue.peek();
queue.dequeue();
Quick sort algorithm
let array = [1,221,32,3,6,4,3,3,2,6,88,4,54,23,6,21,3];
quickSort(array);
Merge sort algorithm
let array = [1,221,32,3,6,4,3,3,2,6,88,4,54,23,6,21,3];
mergeSort(array);
Javascript implementation of binary search.
const array = [1,1,2,3,5,5,5,6,7,13,32,34,45,45,57,67,243,245,3456];
binarySearch(array, 32);
Javascript implementation of binary search tree.
const root = new Node(5);
root.insert(1);
root.insert(3);
root.insert(0);
root.search(3);