implementing trees the tree and binarytree classes that we have defined thus far in this are both formally abstract base classes although they provide great deal of supportneither of them can be directly instantiated we have not yet defined key implementation details for how tree will be represented internallyand how we can effectively navigate between parents and children specificallya concrete implementation of tree must provide methods rootparentnum childrenchildrenlen and in the case of binarytreethe additional accessors left and right there are several choices for the internal representation of trees we describe the most common representations in this section we begin with the case of binary treesince its shape is more narrowly defined linked structure for binary trees natural way to realize binary tree is to use linked structurewith node (see figure athat maintains references to the element stored at position and to the nodes associated with the children and parent of if is the root of then the parent field of is none likewiseif does not have left child (respectivelyright child)the associated field is none the tree itself maintains an instance variable storing reference to the root node (if any)and variablecalled sizethat represents the overall number of nodes of we show such linked structure representation of binary tree in figure root size parent left right baltimore chicago new york providence seattle element ( (bfigure linked structure for representing(aa single node(ba binary tree