Quickselect average complexity

What is the average-case time to find the kkth smallest element of an unsorted array via quickselect?

Show hints (2)+
  1. Unlike quicksort, you recurse into only one partition.
  2. The expected work forms a geometric series.

Answer

Reveal answer →

O(n)O(n)

Create a free account to see the full worked solution and track your progress.

Interview format: Hedge Fund Quant, Systematic & Data-Driven Trading

Related questions