Collection of pure js algorithms.
In JavaScript uses insertion sort by V8 Engine of Chrome and Merge sort by Mozilla Firefox and Safari. It is not suitable if you need to sort large number of elements. So, the solution is to use Quick sort for large dataset.
solves a problem by dividing it into smaller subproblems. This is very similar to the divide-and-conquer algorithm solving technique. The major difference, however, is that dynamic programming solves a subproblem only once. It then stores the result of this subproblem and later reuses this result to solve other related subproblems. This process is known as memoization.
- Find lonely integer in a list; xor all the values and the lonely integer will be the result.
- bubble-sort.js: Bubble sort
- insertion-sort.js: Insertion sort
- merge-sort.js: Merget sort
- selection-sort.js: Selection sort
- quick-sort.js: Quick sort
- binary-search.js: Binary Search
- max-sub-array-sum.js: Maximum Sub Array Sum
- count-negative-ints-sorted-matrix.js: Count Negative Integers in Row/Column Wise Sorted Matrix
- lowest-common-ancestor.js: Lowest common Ancestor
- ways-to-decode-message.js: How many ways to decode a message?
- find-sets-of-numbers-adds-up-to-x.js: Dynamic Programming, Find Sets Of Numbers That Add Up To X
- all-subsets-of-a-set.js: All possible subsets of a set
- detect-cycles-in-linked-list.js: Detect cycles in a given Linked List
- is-valid-binary-trree.js: Check if a Binary Tree is a valid one.
- pair-sums.js: Pair Sums
- rotational-cipher.js: Rotational Cipher
- contiguous-subarrays.js: Contiguous Subarrays
- coin-change.js: Coin Change Problem
- recursive-stair-cases.js Recursice StairCases
- reverse-singley-linked-list.js Reverse A Singly Linked List
- finding-k-smallest-items.js: Finding the K smallest items.
- RANDOMLY Reorder Array in O(N)?
- Find pair of numbers in two arrayas that their sum is closet to a specific target!
- Tower Hopper Problem!
- Finding Continuous Median (Max-Min Heap)
- Merge K sorter Array (brute force, priority queue, min heap)