Open AlexandreHiroyuki opened 2 months ago
Currently, the algorithm sorts the array to select the median element, which consumes n * log n time.
It supposedly could be faster by implementing an algorithm like Introselect to select the median element among an unsorted array.
Other selection algorithms: https://en.wikipedia.org/wiki/Selection_algorithm
Currently, the algorithm sorts the array to select the median element, which consumes n * log n time.
It supposedly could be faster by implementing an algorithm like Introselect to select the median element among an unsorted array.
Other selection algorithms: https://en.wikipedia.org/wiki/Selection_algorithm