Skip to content

Latest commit

 

History

History
66 lines (66 loc) · 1.31 KB

Time_&_Space_Compexity.md

File metadata and controls

66 lines (66 loc) · 1.31 KB

Complexities

Name Time Complexity Space Complexity
Linear Search O(n) O(1)
Binary Search O(log n) O(1)
Kadane's Algorithm O(n) O(1)
Shortest Distance to a Character O(n) O(n)
Selection Sort O(n^2) O(1)
Bubble Sort O(n^2) {Best Case -> O(n)} O(1)
Insertion Sort O(n^2) {Best Case -> O(n)} O(1)
Merge Sort O(n Log n) O(n)
Quick Sort O(n^2) {Best case -> O(n*logn) O(n*logn)
Quick Sort O(n Log n) {Heapify Func -> O(logn)} O(1)
Deleting a node in LL O(n) O(1)
Minimum Remove to Make Valid Parentheses O(n) O(n)