Re: [math] inefficient percentile implementation

2004-11-14 Thread Phil Steitz
Ken Geis wrote: The docs for org.apache.commons.math.stat.descriptive.rank.Percentile state that "To compute percentiles, the data must be (totally) ordered." This is flat out wrong. Sorted, no, ordered, yes. The comment says, "To compute percentiles, the data must be (totally) ordered. Input

[math] inefficient percentile implementation

2004-11-14 Thread Ken Geis
The docs for org.apache.commons.math.stat.descriptive.rank.Percentile state that "To compute percentiles, the data must be (totally) ordered." This is flat out wrong. Sorting first with quicksort leads to O(n lg n) time, and there are selection algorithms for selection that are O(n). Details