index is the rootthe node at index is the root' left childand so onprogressing from left to right along each level of the tree this is shown in figure figure tree represented by an array every position in the treewhether it represents an existing node or notcorresponds to cell in the array adding node at given position in the tree means inserting the node into the equivalent cell in the array cells representing tree positions with no nodes are filled with zero or null with this schemea node' children and parent can be found by applying some simple arithmetic to the node' index number in the array if node' index number is indexthen this node' left child is *index its right child is *index and its parent is (index- (where the '/character indicates integer division with no remainderyou can check this out by looking at the figure in most situationsrepresenting tree with an array isn' very efficient unfilled nodes and deleted nodes leave holes in the arraywasting memory even worsewhen deletion of node involves moving subtreesevery node in the subtree must be moved to its new location in the arraywhich is time-consuming in large trees howeverif deletions aren' allowedthen the array representation may be usefulespecially if obtaining memory for each node dynamically isfor some reasontoo timeconsuming the array representation may also be useful in special situations the tree in the workshop appletfor exampleis represented internally as an array to make it easy to map the nodes from the array to fixed locations on the screen display duplicate keys as in other data structuresthe problem of duplicate keys must be addressed in the code