figure complete binary tree print(bh del_min() print(bh del_min() print(bh del_min() print(bh del_min() binary heap implementation the structure property in order to make our heap work efficientlywe will take advantage of the logarithmic nature of the binary tree to represent our heap in order to guarantee logarithmic performancewe must keep our tree balanced balanced binary tree has roughly the same number of nodes in the left and right subtrees of the root in our heap implementation we keep the tree balanced by creating complete binary tree complete binary tree is tree in which each level has all of its nodes the exception to this is the bottom level of the treewhich we fill in from left to right figure shows an example of complete binary tree another interesting property of complete tree is that we can represent it using single list we do not need to use nodes and references or even lists of lists because the tree is completethe left child of parent (at position pis the node that is found in position in the list similarlythe right child of the parent is at position in the list to find the parent of any node in the treewe can simply use python' integer division given that node is at position in the listthe parent is at position / figure shows complete binary tree and also gives the list representation of the tree note the and relationship between parent and children the list representation of the treealong with the full structure propertyallows us to efficiently priority queues with binary heaps