the level numbering function suggests representation of binary tree by means of an array-based structure (such as python list)with the element at position of stored at index (pof the array we show an example of an array-based representation of binary tree in figure figure representation of binary tree by means of an array one advantage of an array-based representation of binary tree is that position can be represented by the single integer ( )and that position-based methods such as rootparentleftand right can be implemented using simple arithmetic operations on the number (pbased on our formula for the level numberingthe left child of has index ( the right child of has index ( and the parent of has index  ( )/ we leave the details of complete implementation as an exercise ( - the space usage of an array-based representation depends greatly on the shape of the tree let be the number of nodes of and let fm be the maximum value of (pover all the nodes of the array requires length fm since elements range from [ to afm note that may have number of empty cells that do not refer to existing nodes of in factin the worst casen the justification of which is left as an exercise ( - in section we will see class of binary treescalled "heapsfor which thusin spite of the worst-case space usagethere are applications for which the array representation of binary tree is space efficient stillfor general binary treesthe exponential worst-case space requirement of this representation is prohibitive another drawback of an array representation is that some update operations for trees cannot be efficiently supported for exampledeleting node and promoting its child takes (ntime because it is not just the child that moves locations within the arraybut all descendants of that child