array
array copied to clipboard
Median/quantile/bottoms*/tops* can be log(n) faster
Median/quantile/bottoms*/tops* fully sort the data prior to returning the results, which is O(n log n). However, all those could be O(n) by using a selection algorithm instead.
For an example implementation, see https://github.com/simple-statistics/simple-statistics/pull/146 I also have a fast standalone selection module: https://github.com/mourner/quickselect
Of course; I mentioned selection algorithms in the linked notebook. Your contribution would be welcome here! And if not, I’ll do it when I find time. Thanks for the reminder.