One way to implement priority queues is with an array or list. You step through the list, looking at elements in turn. That is, we broke up the parts of the data structure to build substructures. The highest-priority element of the priority queue. Because each node has two subtrees, we call it a binary tree .
Trees are common data structures.
We'll revisit them a few times in the coming weeks. Remove that element. This creates a hole at the root of the tree. Put highest-priority root of a subtree in that hole, creating a hole in that subtree. Recurse on the subtree.