- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
I want to describe an algorithm with time complexity $O(m)$ that, given a set $M$ with $m$ numbers and a positive integer $p \leq m$, returns the $p$ closest numbers to the median element of the set $M$.
How could we do this? (Thinking)
I want to describe an algorithm with time complexity $O(m)$ that, given a set $M$ with $m$ numbers and a positive integer $p \leq m$, returns the $p$ closest numbers to the median element of the set $M$.
How could we do this? (Thinking)
Last edited: