Array Sorting Algorithms Time and Space Complexity Flashcards

1
Q

What is the best, average, and worst time complexity for quicksort? What is the worst space complexity?

A
Best = Ω(n log n)
Average = Θ(n log n)
Worst = O(n^2)
Space = O(log n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the best, average, and worst time complexity for mergesort? What is the worst space complexity?

A
Best = Ω(n log n)
Average = Θ(n log n)
Worst = O(n log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the best, average, and worst time complexity for timsort? What is the worst space complexity?

A
Best = Ω(n)
Average = Θ(n log n)
Worst = O(n log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the best, average, and worst time complexity for heapsort? What is the worst space complexity?

A
Best = Ω(n log n)
Average = Θ(n log n)
Worst = O(n log n)
Space = O(1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the best, average, and worst time complexity for bubble sort? What is the worst space complexity?

A
Best = Ω(n)
Average = Θ(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

What is the best, average, and worst time complexity for insertion sort? What is the worst space complexity?

A
Best = Ω(n)
Average = Θ(n^2)
Worst = O(n^2)
Space = O(1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the best, average, and worst time complexity for selection sort? What is the worst space complexity?

A
Best = Ω(n^2)
Average = Θ(n^2)
Worst = O(n^2)
Space = O(1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the best, average, and worst time complexity for tree sort? What is the worst space complexity?

A
Best = Ω(n log n)
Average = Θ(n log n)
Worst = O(n^2)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the best, average, and worst time complexity for shell sort? What is the worst space complexity?

A
Best = Ω(n log n)
Average = Θ(n (log n)^2)
Worst = O(n (log n)^2)
Space = O(1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the best, average, and worst time complexity for bucket sort? What is the worst space complexity?

A
Best = Ω(n + k)
Average = Θ(n + k)
Worst = O(n^2)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the best, average, and worst time complexity for radix sort? What is the worst space complexity?

A
Best = Ω(nk)
Average = Θ(nk)
Worst = O(n^2)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the best, average, and worst time complexity for counting sort? What is the worst space complexity?

A
Best = Ω(n + k)
Average = Θ(n + k)
Worst = O(n + k)
Space = O(k)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the best, average, and worst time complexity for cubesort? What is the worst space complexity?

A
Best = Ω(n)
Average = Θ(n log n)
Worst = O(n log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly