問題詳情
41. Regarding QUICKSORT, which of the following statements is WRONG?
(A)When there is an array of length n, all elements of which have the same value, whenQUICKSORT is used to sort this array, the execution time is Θ(n2)
(B)The best execution time of QUICKSORT is Θ(n2)
(C)Same as the previous array. When all elements have different values, and sorted indescending order first, use QUICKSORT to sort this array, and its execution time isΘ(n2)
(D)The worst execution time of QUICKSORT is Θ(n2)
參考答案
答案:B
難度:計算中-1
書單:沒有書單,新增
用户評論
【小彥子老師】評論
關於 QUICKSORT,以下哪個說法是錯誤的?(A) 當有一個長度為 n 的數組,所有元素的值都相同時,當使用 QUICKSORT 對該數組進行排序時,執行時間為 Θ(n 2 )(B) QUICKSORT 的最佳執行時間是 Θ(n 2 )-->Best Case: O(n log n)(C) 與前一個數組相同。 當所有元素的值不同,並且先降序排序時,使用QUICKSORT對這個數組進行排序,其執行時間為Θ(n 2 )(D) QUICKSORT 的最差執行時間是 Θ(n 2 )