This question is for recurrence equation, so we have to apply divide and conquer approach. Finding Kth smallest element using divide and conquer algorithm is known as Selection procedure. Selection procedure is similar to quick sort partition algorithm. After every pass we will get one element at it's correct position. This position is nothing but smallest value at this position . Suppose after first pass we will get pivot element at 7th position so 7th smallest element is Pivot element.
Difference between quick sort and selection procedure is, in quick sort we will partitioning array in two parts but here we only partitioning array into one part.
We will partitioning array into only one part because after every pass we exact know that either we will go at right partition or left partition.
Example :
15,25,10,85,75,95,87,5,6
Here we have 9 elements array and we want to find 3rd smallest number.
Now we apply partitioning algorithm and take pivot as first element
First pass output ---->6 10 5 [15] 75 95 87 23 85 ------>15 is at 4th position so 15 is 4th smallest but we want 3rd smallest so we will go to left partition and we have only three elements 6 10 5
Second pass output---->5 [6] 10 ----->6 is at 2nd position so 6 is 2nd smallest but we want 3rd smallest so we will go to right and we have only one element 10
So our 3rd smallest element is ----------->10
Now we all now that in worst case partition will be occur in (n-1) part so
T(n) = T(n – 1) + c . n