The linked proof for that median of medians is O(n) feels counterintuitive to me. Here's a (simpler?) alternative. T(0) = 0 T(1) = 1 T(n) = n + T(n/5) + T(7/10*n) We want to prove that: T(n) ≤ C*n It is intuitive that T(a+b) ≥ T(a) + T(b), or in other words, T is superadditive. That can be shown by induction: Induction base: it holds for all a+b T(0+0) = 0 + T(0) + T(0) ≥ T(0) + T(0) Induction step: suppose it holds…
Here is the slightly mopped up proof i had in mind, when i posted my hints below:
Let be r>=1 and 0 1 for all 1 0 and
T(0) := 0
T(n) := c \* n + T(floor(n/a(1))) + ... + T(floor(n/a(r)))
Then T(n) 0 !
Proof by induction:
"n=0" :
The statement holds trivially.
"k->n":
Let n>=1 and assume the statement holds for all 01 we have floor(n/a(i))