Re: Median: Oasis and Fast Sorting Algorithm

On Sat, 2007-10-02 at 11:48 +0200, Uri David Akavia wrote:

While I'm not sure about revising the algorithm, you might be right
about the definition - define it as "MEDIAN will return the value that
WOULD be in the middle IF sorted" and then you won't force anyone to
sort. I still think most people will, since median discovery by
sorting is fast enough for most practical purposes, and it is much
simpler (hence, but free) then more complicated code.

As I said before the OpenFormula standard does not prescribe algorithms.
The definition (this is from the January 25th draft, I don't think this
section has changed since then) says:

MEDIAN logically sorts the numbers (lowest to highest).  If given an odd
number of values, MEDIAN returns the middle value. If given an even
number of values, MEDIAN returns the arithmetic average of the two
middle values.

Please feel free to suggest a clear alternative. (Please use
grammatically correct sentences. For example the above sentence "...if
sorted" is not and would therefore not be acceptable. Also use
structures that are likely to be understandable to non-native-english

Of course anything of the complexity suggested in this thread previously
would not be acceptable.


Member of the OpenFormula TC.
Andreas J. Guelzow
Pyrenean Shepherds

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]