/DSA-JavaScript

A repo of Data Structure and Algorithm concepts with JavaScript

Primary LanguageJavaScript

DSA-JavaScript

A repo of Data Structures and Algorithms concepts with JavaScript.

Sorting Algorithms

Name/Complexity Worst Case Average Case Best Case Space Complexity Stable
1. Insertion Sort O(n^2) O(n^2) O(n) O(1) Yes
2. Bubble Sort O(n^2) O(n^2) O(n) O(1) Yes
3. Selection Sort O(n^2) O(n^2) O(n^2) O(1) No
4. Merge Sort O(nlogn) O(nlogn) O(nlogn) O(n) Yes
5. Quick Sort O(n^2) O(nlogn) O(nlogn) O(n)/O(logn) No
5a. Random Quick Sort O(nlogn) O(nlogn) O(nlogn) O(logn) No
6. Counting Sort O(n+k) O(n+k) O(n+k) O(n+k) Yes
7. Radix Sort O(d*(n+b)) O(d*(n+b)) O(d*(n+b)) O(n+b) Yes

n = length of input array
k = range of input elements
d = number of digits in largest element
b = base Size (10 for decimals)

Recursion (Pending...)

  1. Factorial of n
  2. Summation of numbers from 1 to n
  3. Base Conversion
  4. Exponentiation of a number
  5. Prime Factorization
  6. Greatest Common Divisor
  7. Fibonacci Series
  8. Divisibility Check by 9 and 11
  9. Tower of Hanoi

Searching Algorithms

  1. Linear Search (Sequential Search)
  2. Binary Search

Binary Search Tree (Up next...)

  1. Traversal in BST
  2. Searching in BST
  3. Finding Nodes with Max. and Min. Value
  4. Insertion in BST
  5. Deletion in BST