On Friday, 11 September 2015 at 12:23:52 UTC, ixid wrote:
Yes, I was reading about heapsort. I was only thinking about the usability POV (I mean isn't reduced pretty much an eager operation that accepts a lazy input? Why can't sort do that?) but it could also offer some performance improvement if you only use a part of the sorted array.

I think there is something called "partial sort" in Phobos, but "lazy" sorting is the same as a priority queue.

You need to look at all elements before finding the largest one, that's why you cannot turn sort into a plain generator (or lazy range as some may call it).

Reply via email to