ReverseHeap

tree-like automatic ordering of a set for the purpose of getting the highest value quickly. This is faster than a normal binary search tree as it actually uses an array

new virtuosity.structures.ReverseHeap();


Parameter Type Description

Methods


Methods

size

get the size of the reverse heap

virtuosity.structures.ReverseHeap.size();

push

add a value to the reverse heap

virtuosity.structures.ReverseHeap.push(val);


Parameter Type Description
val Number vale to add to the reverse heap

print

print the array of the reverse heap

virtuosity.structures.ReverseHeap.print();

peek

get the highest value

virtuosity.structures.ReverseHeap.peek();

pop

get and remove the highest value

virtuosity.structures.ReverseHeap.pop();

remove

get and remove a value from a specific index

virtuosity.structures.ReverseHeap.remove(i);


Parameter Type Description
i Int index of the value to remove