i've spent past couple of days searching for an efficient algorithm to calculate median value that would be displayed in stats tables as the average value can be misleading sometimes. however i didn't find anything that calculates median in a single iteration over a list of values. all algorithms need multiple iterations and/or store the input values in a list. that's not usable in expert lotto as it processes millions of input values.
so i was thinking that i'd allow definition of 3 to 5 intervals for each stats table and then show how many values fall into each interval. the intervals would be user-defined as the user knows best what the range of values should and what to expect.
what do you think?