Big O Flashcards
1
Q
Find on a BST (average & worst case)
A
Avg O(logn) Worst O(n)
2
Q
Find on an AVL BST (average & worst case)
A
A O(logn) W O(logn)
3
Q
Find on a hash table (average & worst case)
A
A O(1) W O(n)
4
Q
Insert on a heap (average & worst case)
A
A O(1) W O(logn)
5
Q
Remove on a heap (average & worst case)
A
A O(logn) W O(logn)
6
Q
Heapify on an array (average & worst case)
A
A O(n) W O(n)
7
Q
Get on an array (worst case)
A
O(1)
8
Q
Get on a Linked List (worst case)
A
O(n)
9
Q
Push on a stack (worst case)
A
O(1)
10
Q
Pop on a stack (worst case)
A
O(1)
11
Q
Add on a Queue (worst case)
A
O(1)
12
Q
Remove on a queue (worst case)
A
O(1)