News for hackers. Stuff that matters.
Re:Fast incremental sort by Scea91 on Sunday April 24, 2016 @12:56PM (#11560361)
The items are sorted after each insertion.
Re:Fast incremental sort by larshagencpp on Sunday April 24, 2016 @01:00PM (#11560389)
Yes, but the incrmental sorting problem requires that the k elements are not only sorted, but are the k first elements of the whole sequence of length N.
Re:Fast incremental sort by cyphar on Monday April 25, 2016 @07:21AM (#11563534)
Why does that make a difference? Every insertion into an RB tree self-balances and sorts the elements. So if you sort the first k elements (insert them in the tree), sorting the next element is fairly cheap (log k). Maybe I'm misunderstanding what you mean.