Algorithms Flashcards
1
Q
Linear search Big-O
A
Best: O(1)
Average: O(n)
Worst: O(n)
2
Q
Binary search Big-O
A
Best: O(1)
Average: O(logn)
Worst: O(logn)
3
Q
Binary tree search Big-O
A
Best: O(1)
Average: O(logn)
Worst: O(logn)
4
Q
Bubble sort Big-O
A
Best: O(n)
Average: O(n^2)
Worst: O(n^2)
Space: O(1)
5
Q
Insertion sort Big-O
A
Best: O(n)
Average: O(n^2)
Worst: O(n^2)
Space: O(1)
6
Q
Merge sort Big-O
A
Best: O(nlogn)
Average: O(nlogn)
Worst: O(nlogn)
Space: O(n)
7
Q
Quick sort Big-O
A
Best: O(nlogn)
Average: O(nlogn)
Worst: O(n^2)
Space: O(logn)
8
Q
Hash table Big-O
A
O(1)