Big O Notation Flashcards
(37 cards)
linear search best case time complexity
O(1)
linear search average case time complexity
O(n)
linear search worst case time complexity
O(n)
Binary search array best case time complexity
O(1)
Binary search array average case time complexity
O(log n)
Binary search array worst case time complexity
O(log n)
Binary search tree best case time complexity
O(1)
Binary search tree average case time complexity
O(log n)
Binary search tree worst case time complexity
O(n)
Hashing best case time complexity
O(1)
Hashing average case time complexity
O(1)
Hashing worst case time complexity
O(n)
Breadth/depth-first of graph best case time complexity
O(1)
Breadth/depth-first of graph average case time complexity
O(V+E)
Breadth/depth-first of graph worst case time complexity
O(V^2)
Bubble sort best case time complexity
O(n)
Bubble sort average case time complexity
O(n^2)
Bubble sort worst case time complexity
O(n^2)
Bubble sort space complexity
O(1)
Insertion sort best case time complexity
O(n)
Insertion sort average case time complexity
O(n^2)
Insertion sort worst case time complexity
O(n^2)
Insertion sort space complexity
O(1)
Merge sort best case time complexity
O(n log n)