the tree abstract data type as we did with positional lists in section we define tree adt using the concept of position as an abstraction for node of tree an element is stored at each positionand positions satisfy parent-child relationships that define the tree structure position object for tree supports the methodp element)return the element stored at position the tree adt then supports the following accessor methodsallowing user to navigate the various positions of treet root)return the position of the root of tree tor none if is empty is root( )return true if position is the root of tree parent( )return the position of the parent of position por none if is the root of num children( )return the number of children of position children( )generate an iteration of the children of position is leaf( )return true if position does not have any children len( )return the number of positions (and hence elementsthat are contained in tree is empty)return true if tree does not contain any positions positions)generate an iteration of all positions of tree iter( )generate an iteration of all elements stored within tree any of the above methods that accepts position as an argument should generate valueerror if that position is invalid for if tree is orderedthen children(preports the children of in the natural order if is leafthen children(pgenerates an empty iteration in similar regardif tree is emptythen both positionsand iter(tgenerate empty iterations we will discuss general means for iterating through all positions of tree in sections we do not define any methods for creating or modifying trees at this point we prefer to describe different tree update methods in conjunction with specific implementations of the tree interfaceand specific applications of trees