what's the most efficient way to implement std.container.binaryheap.back()?

mw mingwu at gmail.com
Mon Oct 25 04:49:12 UTC 2021


Hi,

https://dlang.org/phobos/std_container_binaryheap.html

The binary heap induces structure over the underlying store such 
that accessing the largest element (by using the front property) 
is a Ο(1) operation.

I'm wondering what's the most efficient (in terms of both speed 
and memory usage) way to implement 
std.container.binaryheap.back()? i.e accessing the smallest 
element.

Has anyone done this before?

Thanks.



More information about the Digitalmars-d-learn mailing list