Existing BinaryHeap::iter()
returns an iterator that visits underlying data in arbitrary order.
I think it’s worth adding a sorted version.
BinaryHeap
already has into_sorted_vec()
method, but using the iterator should be more performant in some cases.
I couldn’t find any previous discussion.
One question is that in what order the sorted iterator should visit the underlying data.
BinaryHeap::pop()
returns the greatest item, while into_sorted_vec()
sorts the data in ascending order.