Big 0 Time Flashcards
1
Q
Linear Time
A
O(n)
2
Q
Constant Time
A
O(1)
3
Q
Quadratic Time
A
O(n^2)
4
Q
What scenario do we care about when measuring time complexity?
A
Worst case scenario/upper bound
5
Q
Logarithmic Time
A
O(logn)
6
Q
Traveling Salesman Time Complexity
A
O(n!)
7
Q
Bubble Sort Time Complexity
A
O(n^2)
8
Q
Insertion Sort Time Complexity
A
O(n^2)
9
Q
Merge Sort Time Complexity
A
O(nlogn)
10
Q
Quicksort Time Complexity
A
O(nlogn)
11
Q
Binary Search Time Complexity
A
O(logn)
12
Q
First Recurring Character in a string Time Complexity
A
O(n^2)
13
Q
Rank the algorithms Rate of Increase for Big O
A
O(logn)>O(n)>O(nlogn)>O(n^2)>O(2^n)>O(n!)
14
Q
When there is a function with multiple calls, the runtime will often be:
A
O(branches^depth)
15
Q
Binary Tree Insert/find
A
O(logn)