Question
Easy

Which of the following recurrence relation is related to worst case time complexity of quick sort ?

1
$T(n)=T(n/2)+C$
2
$T(n)=2.T(n/2)+Cn$
3
$T(n)=T(n-1)+Cn$
4
$T(n)=7.T(n/2)+Cn^2$
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Software Engineering & Problem Solving
Topic: Programming Concepts
Correct Answer
Option C
Explanation

The correct option is (3): The recurrence relation for the worst-case time complexity of Quick Sort is $T(n)=T(n-1)+Cn$. The worst-case is triggered when the pivot selection consistently leads to the most unbalanced split possible. This occurs when the pivot always happens to be the smallest or largest element in the sub-array, dividing the problem of size $n$ into a subproblem of size $n-1$ and a trivial subproblem of size 0.…Read More

Which of the following - HTET Level 3 | Clear Cutoff