BigO Notation Flashcards
Best scenario for linear search
O(1) - constant
Average scenario for linear search
O(n) - linear
Worst scenario for linear search
O(n) - linear
Best scenario for binary search
O(1) - constant
Average scenario for binary search
O(log n) - logarithmic
Worst scenario for binary search
O(log n) - logarithmic
Best scenario (time) for bubble sort
O(n) - linear
Average scenario (time) for bubble sort
O(n^2) - polynomial
Worst scenario (time) for bubble sort
O(n^2) - polynomial
Space complexity for bubble sort
O(1) - constant
Best scenario (time) for insertion sort
O(n) - linear
Average scenario (time) for insertion sort
O(n^2) - polynomial
Worst scenario (time) for insertion sort
O(n^2) - polynomial
Space complexity for insertion sort
O(1) - constant
Best scenario (time) for merge sort
O(n log n) - linearithmic
Average scenario (time) for merge sort
O(n log n) - linearithmic
Worst scenario (time) for merge sort
O(n log n) - linearithmic
Space complexity for merge sort
O(n) - linear
Best scenario (time) for quick sort
O(n log n) - linearithmic
Average scenario (time) for quick sort
O(n log n) - linaerithmic
Worst scenario (time) for quick sort
O(n^2) - polynomial
Space complexity for quick sort
O(log n) - logarithmic
Order of bigO
CLoLiLinPolE (Constant, Logarithmic, Linear, Linearithmic, Polynomial, Exponential)
Explain the bigO notation O(1)
Constant complexity. Executes in the same amount of time regardless of data set.