PriorityQueue and Heap
Priority Queues
Heaps
Insertion:
Deletion:
Representation
public int parent(int k) {
return (k - 1) / 2
}Last updated
public int parent(int k) {
return (k - 1) / 2
}Last updated
leftChild(k) = 2k
rightChild(k) = 2k + 1
parent(k) = k/2