Recursive Thinking — Kth Smallest
Design a recursive algorithm to solve the following problem. Do not write any code.
Find the kth smallest value in an array t of numbers.
Hint: If kequals the size of t, then return the largest value in t. Otherwise, create two new arrays, one containing the values less than t [0] and one with the values larger than or equal to t [0]. (If allthe values are larger than or equal to t [0], then move t [0] to the empty first array.) Keep track of how many elements are in each new array. Now what?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.