In this example, the binary heap is represented as a tree with the highest value at the root. When the root has children, it is removed and its children become the new root, until the tree is empty. The values are then sorted by following the path of their parent nodes.