tps/bb.ndu.edulb/webapps/assessment/take/launchjsp\'course.assessment id QUESTIO
ID: 3713355 • Letter: T
Question
tps/bb.ndu.edulb/webapps/assessment/take/launchjsp'course.assessment id QUESTION The complexity of quick sort O Ranges from e(n) in the best case to e(n2) in the worst case O Ranges trom 0(n log n) in the best case to @in?) in the worst case O Ranges from @(n ) in the best case to O(n log n) in the worst case O It is always Oin log n) no matter what the choice of the pivot is QUESTION 2 The complexity of merge sort is o ein log n) sometimes, depending on the input data o 8in log n) always o 8in log n) sometimes, depending on the ahoice at the pivo O it is never ∈ log nj QUESTION 3 Suppose that in quicksort the largest element in the array is alvays chosen as the pivot in that case the complesity of quicksort s ?(n logn |Explanation / Answer
1) For quick short best case time complexity is O(nlogn) but worst case it is O(n2).
worst case occurse in array already sorted.
so answer is b.
2) answe is b .In merge sort time complexity remain same O(nlogn) in all cases.
3)O(n2)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.