問題詳情

8. Let T(n) denote the time taken to sort a list of n records. Which of the following statements are false forQuickSort?
(A) T(n) = 2T(n/2) + cn for some constant c in the worst-case scenario.
(B) T(n) = 4T(n/4) + cn for some constant c in the worst-case scenario.
(C) T(n) = T(n-1) + cn for some constant c in the worst-case scenario.
(D) T(n) = 2T(n-2) + cn for some constant c in the best-case scenario.

參考答案

答案:[無官方正解]
難度:計算中-1
書單:沒有書單,新增

用户評論

December Ann】評論

(A)錯誤,worst case應為T(n)=T(n-1)+cn(題目2T(n/2)+cn應為best case)(B)錯誤,worst case應為T(n)=T(n-1)+cn(C)正確(D)錯誤