PairingHeap

Members

Functions

front
inout(T) front()
Undocumented in source. Be warned that the author may not have intended to support it.
insert
void insert(T item)
Undocumented in source. Be warned that the author may not have intended to support it.
meld
void meld(PairingHeap r)

meld two heaps Warning: r become empty

removeFront
void removeFront()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

empty
bool empty [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

auto p1 = PairingHeap!int();
auto p2 = PairingHeap!int();

p1.insert(1);
p1.insert(2);
assert(p1.front == 2);

p2.insert(3);
assert(p2.front == 3);

p1.meld(p2);
assert(p1.length == 3 && !p2.length);

assert(p1.front == 3); p1.removeFront();
assert(p1.front == 2); p1.removeFront();
assert(p1.front == 1); p1.removeFront();

Meta