3 ms·
> ... I've never had to write code to compute the median so it doesn't seem that useful unless it's somehow relevant to the job A binary search[0] of a sorted
by AdieuToLogic 3mo ago
> ... I've never had to write code to compute the median so it doesn't seem that useful unless it's somehow relevant to the job
A binary search[0] of a sorted collection requires the median of each region being considered for each iteration.
0 - https://en.wikipedia.org/wiki/Binary_search https://en.wikipedia.org/wiki/Binary_search
- halayli 3mo agoNot picking on you but your answer prove the parent comment's point. Your answer is that of someone that googled some answer and went with it. This problem belongs to selection algorithms and quickselect is the common approach.
- AdieuToLogic 3mo ago> Your answer is that of someone that googled some answer and went with it. My answer was one from experience and supported by a resource which provides details as to why medians are needed in real-world scenarios. > This problem belongs to selection algorithms and quickselect is the common approach. I responded to a specific comment in this discussion, not to what "this problem belongs."