Creating a Priority Queue: An Adventure
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Aug 6 02:39:39 PDT 2015
On Thursday, 6 August 2015 at 09:08:04 UTC, John Colvin wrote:
> Worst case for getting root off a binary heap is O(log(N)),
> copying the whole thing is O(N).
Those numbers does not take into account the special properties
of *in-array-packed* implementation of a binary heap. They are
*theoretical properties* related to a graph implementation of a
`BinaryHeap`.
The important thing in our D case is *which elements* in the
array that needs to be changed or *moved*.
More information about the Digitalmars-d-learn
mailing list