PriorityQueue

priority queue

new virtuosity.structures.PriorityQueue();


Parameter Type Description

Classes

Methods


Classes

Node

PriortyQueue node



Methods

push

add a node to the PriorityQueue

virtuosity.structures.PriorityQueue.push(data);


Parameter Type Description
data ANY data for the new node

peek

get the front of the PriorityQueue

virtuosity.structures.PriorityQueue.peek();

pop

remove the top node

virtuosity.structures.PriorityQueue.pop();

delete

delete a specific node

virtuosity.structures.PriorityQueue.delete(node);


Parameter Type Description
node ANY data of the Node to delete

get

get a specific node

virtuosity.structures.PriorityQueue.get(node);


Parameter Type Description
node ANY data of the Node to get

setPriority

change the priority of a specific node

virtuosity.structures.PriorityQueue.setPriority(node, priority);


Parameter Type Description
node ANY data of the Node to change the priority of
priority Number the new priority

size

get the size of the PriorityQueue

virtuosity.structures.PriorityQueue.size();

print

output an array representation of the PriorityQueue

virtuosity.structures.PriorityQueue.print();

forEach

enumerate over all nodes in the PriorityQueue

virtuosity.structures.PriorityQueue.forEach(event);


Parameter Type Description
event Function event to run on all nodes in the PriorityQueue (takes node as a parameter)

reverseForEach

enumerate over all nodes in the PriorityQueue in reverse order

virtuosity.structures.PriorityQueue.reverseForEach(event);


Parameter Type Description
event Function event to run on all nodes in the PriorityQueue (takes node as a parameter)