When QuickSort repeatedly produces highly skewed partitions (for example, the pivot always becomes the smallest or largest element), what is the resulting time complexity, given the explanations below?  单项选择题

A

Θ(n²) — because the recursion depth becomes n and each level involves linear work

B

Θ(n log n) — because the recursion tree remains balanced regardless of pivot choice

C

Θ(1) — because partitioning becomes a constant time operation in the worst case

D

Θ(log n) because only logarithmic levels of recursion are needed to reach the base case

E

Θ(n) — because each element is compared only once during the entire process

F

Θ(n²) — because the partition operation takes quadratic time on sorted inputs

G

Θ(n²) — because the algorithm reverts to a linear search pattern

H

Θ(n²) — because the recursion depth becomes 1 and each level has linear work

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!