in reply to Re: Points on a line and associated intervals
in thread Points on a line and associated intervals

Although you are selecting the smallest interval to discard a point from each time, when you consolidate the remaining point to a new interval, you are taking no account of the relative size of the new intervals you are creating.

I didn't explain things properly, then. At each iteration, I am taking the smallest interval of the remaining intervals where the two old intervals have been appropriately collapsed to a new interval after each point removal. Sorry if I wasn't clear.

  • Comment on Re^2: Points on a line and associated intervals

Replies are listed 'Best First'.
Re^3: Points on a line and associated intervals
by BrowserUk (Patriarch) on May 18, 2006 at 12:28 UTC

    That was clear. The code I posted does that by insertion sorting the new interval back into the sorted list of remaining intervals. Still, the result is the selection of the 10 highest quality points via a very slow algorithm. It will always favour quality over distance, and regularity of spacing is never considered.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.