Median of Medians

Saw this in CS341.