Question discussion

What is the worst case running time of quick sort algorithm?

358609Medium DSSSB TGT Computer Science 0 replies 0 views
0
What is the worst case running time of quick sort algorithm?
  • AΘ(x log2x2)
  • BΘ(x)
  • CΘ(x log2x)
  • DΘ(x2)
Correct answer: D

Explanation

In the worst case quick sort picks a bad pivot every time and splits the array into n–1 and 0 elements, so the running time is Θ(n²).

Discussion 0

Nobody has replied yet. Start the discussion!