Sorting Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Bubble Sort Time Complexity

A

Best - O(n)
Average - O(n2)
Worst - O(n2)

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

Insertion Sort Time Complexity

A

Best - O(n)
Average - O(n2)
Worst - O(n2)

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

Bubble Sort Space Complexity

A

O(1)

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

Insertion Sort Space Complexity

A

O(1)

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

Merge Sort Time Complexity

A

Best - O(n log n)
Average - O(n log n)
Worst - O(n log n)

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

Merge Sort Space Complexity

A

O(n)

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

Quick Sort Time Complexity

A

Best - O(n log n)
Average - O(n log n)
Worst - O(n2)

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

Quick Sort Space Complexity

A

O(log n)

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