SplMinHeap
class SplMinHeap extends SplHeap (View source)
Methods
Extracts a node from top of the heap and sift up.
Inserts an element in the heap by sifting it up.
Peeks at the node from the top of the heap
Counts the number of elements in the heap.
Checks whether the heap is empty.
Rewind iterator back to the start (no-op)
Return current node pointed by the iterator
Return current node index
Move to the next node
Check whether the heap contains more nodes
Recover from the corrupted state and allow further actions on the heap.
Compare elements in order to place them correctly in the heap while sifting up.
Details
mixed
extract()
Extracts a node from top of the heap and sift up.
bool
insert(TValue $value)
Inserts an element in the heap by sifting it up.
mixed
top()
Peeks at the node from the top of the heap
int
count()
Counts the number of elements in the heap.
bool
isEmpty()
Checks whether the heap is empty.
void
rewind()
Rewind iterator back to the start (no-op)
mixed
current()
Return current node pointed by the iterator
mixed
key()
Return current node index
void
next()
Move to the next node
bool
valid()
Check whether the heap contains more nodes
bool
recoverFromCorruption()
Recover from the corrupted state and allow further actions on the heap.
protected int
compare(mixed $value1, mixed $value2)
Compare elements in order to place them correctly in the heap while sifting up.
bool
isCorrupted()
No description
array
__debugInfo()
No description