What is recurrence for worst case of QuickSort and what is the time complexity in Worst case?
- Recurrence is T(n) = T(n-2) + O(n) and time complexity is O(n^2)
- Recurrence is T(n) = 2T(n/2) + O(n) and time complexity is O(nLogn)
- Recurrence is T(n) = T(n-1) + O(n) and time complexity is O(n^2)
- Recurrence is T(n) = T(n/10) + T(9n/10) + O(n) and time complexity is O(nLogn)
Correct Answer:
Recurrence is T(n) = T(n-1) + O(n) and time complexity is O(n^2)
need an explanation for this answer? contact us directly to get an explanation for this answer