...
Question 8580 – Algorithms
January 29, 2024
Question 10215 – CPU-scheduling
January 30, 2024
Question 8580 – Algorithms
January 29, 2024
Question 10215 – CPU-scheduling
January 30, 2024

Question 11277 – Algorithms

Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following are TRUE?
I. Quick sort runs in Q(n2) time
II. Bubble sort runs in Q(n2) time
III. Merge-sort runs in Q(n2) time
IV. Insertion sort runs in Q(n2) time

Correct Answer: E

Question 416 Explanation: 
Quick sort runs in O(n2) if the input is already in sorted order.
Bubble sort runs in O(n) time if the input is already in sorted order.
Merge sort runs in O(nlogn) time.
Insertion sort runs in O(n) time.
A
I and II only
B
I and III only
C
II and IV only
D
I and IV only
E
None of the above.
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!!