Find k-th smallest element in array.
Find k-th smallest element in array.
Approach: Use quickselect algorithm.
Quickselect: Partition array around pivot. If pivot index == k, return arr[pivot]. If k < pivot index, recurse on left, else recurse on right. Expected O(n), worst O(n²).
Follow-up: Worst-case linear time algorithm?
Key concepts: selection algorithm, partition, expected linear time.