Algorithms Flashcards

1
Q

Linear search Big-O

A

Best: O(1)
Average: O(n)
Worst: O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Binary search Big-O

A

Best: O(1)
Average: O(logn)
Worst: O(logn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Binary tree search Big-O

A

Best: O(1)
Average: O(logn)
Worst: O(logn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Bubble sort Big-O

A

Best: O(n)
Average: O(n^2)
Worst: O(n^2)
Space: O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Insertion sort Big-O

A

Best: O(n)
Average: O(n^2)
Worst: O(n^2)
Space: O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Merge sort Big-O

A

Best: O(nlogn)
Average: O(nlogn)
Worst: O(nlogn)
Space: O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Quick sort Big-O

A

Best: O(nlogn)
Average: O(nlogn)
Worst: O(n^2)
Space: O(logn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Hash table Big-O

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly