FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
Action summary | |
---|---|
integer | static create(any comparator)
Create an empty heap with the given comparator. The comparator determines if this is a min-heap or a max-heap and how to compare the values. |
boolean |
empty()
Returns true if the heap is empty. |
integer | static heapify(sequence<any> data, any comparator)
Create an in-place heap on the given sequence, with the given comparator. The comparator determines if this is a min-heap or a max-heap and how to compare the values. |
any |
peekTop()
Return the top value from the heap, according to its comparator. |
any |
pop()
Remove and return the top value from the heap, according to its comparator, maintaining the heap. |
void |
push(any val)
Push a new value into the heap, maintaining the heap. |
integer |
size()
Returns the number of values in the heap. |
Action detail |
---|
integer static create(any comparator)Create an empty heap with the given comparator. The comparator determines if this is a min-heap or a max-heap and how to compare the values.
boolean empty()Returns true if the heap is empty.
integer static heapify(sequence<any> data, any comparator)Create an in-place heap on the given sequence, with the given comparator. The comparator determines if this is a min-heap or a max-heap and how to compare the values.
any peekTop()Return the top value from the heap, according to its comparator.
any pop()Remove and return the top value from the heap, according to its comparator, maintaining the heap.
void push(any val)Push a new value into the heap, maintaining the heap.
integer size()Returns the number of values in the heap.
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |