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