Big O Notation for Running Time for commonly used algorithms
Big O notation represents functions according to their growth rates. Also note that different functions with the same growth rate are using the same Big O Noation.
In contrast to data struct and algorithms, the running time is important and it can be represented with Big O Noation.
Running Time Analysis
O(1) - Indexing / Accessing Elements in Arrays or Hash Table Algorithm
O(n) - Indexing / Accessing Elements in Linked List
O(n^2) - O(n*n) - Bubble Sort or Selection Sort or Insertion Sort or QuickSort (worst case)
O(n Log n) = O(Log n! ) LogLinear - Heap Sort, Merge Sort or QuickSort (Best and Average Case)
O(Log n) - Finding Elements in Sorted Array or Binary Search Tree
O(n!) - All possible combination - Solving Travelling Sales Man Problem with Brute-Force Search
|