priority queues and heap trees trees stored in arrays it was noted earlier that binary trees can be stored with the help of pointer -like structuresin which each item contains references to its children if the tree in question is complete binary treethere is useful array based alternative definition binary tree is complete if every levelexcept possibly the lastis completely filledand all the leaves on the last level are placed as far to the left as possible intuitivelya complete binary tree is one that can be obtained by filling the nodes starting with the rootand then each next level in turnalways from the leftuntil one runs out of nodes complete binary trees always have minimal height for their size nnamely log nand are always perfectly balanced (but not every perfectly balanced tree is complete in the sense of the above definitionmoreoverand more importantlyit is possible for them to be stored straightforwardly in arraystop-to-bottom left-to-rightas in the following examplea[ [ [ [ [ [ [ for complete binary treessuch arrays provide very tight representations notice that this time we have chosen to start the array with index rather than this has several computational advantages the nodes on level then have indices + the level of node with index is blog icthat islog rounded down the children of node with index iif they existhave indices and the parent of child with index has index / (using integer divisionthis allows the following simple algorithmsboolean isroot(int ireturn =