Pointers
October 28, 2023
Sorting
October 28, 2023
Pointers
October 28, 2023
Sorting
October 28, 2023

Sorting

Question 82
An ideal sort is an in-place-sort whose additional space requirement is __________.
A
O (log​ 2​ n)
B
O (n log​ 2​ n)
C
O (1)
D
O (n)
Question 82 Explanation: 
The ideal sorting algorithm would have the following properties:
1. Stable: Equal keys aren’t reordered.
2. Operates in place, requiring O(1) extra space.
3. Worst case O(nlog(n)) key comparisons.
4. Worst case O(n) swaps.
5. Adaptive: Speeds up to O(n) when data is nearly sorted or when there are few unique keys.
Correct Answer: C
Question 82 Explanation: 
The ideal sorting algorithm would have the following properties:
1. Stable: Equal keys aren’t reordered.
2. Operates in place, requiring O(1) extra space.
3. Worst case O(nlog(n)) key comparisons.
4. Worst case O(n) swaps.
5. Adaptive: Speeds up to O(n) when data is nearly sorted or when there are few unique keys.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!