- given proper binary tree define the reflection of to be the binary tree such that each node in is also in but the left child of in is ' right child in and the right child of in is ' left child in show that preorder traversal of proper binary tree is the same as the postorder traversal of ' reflectionbut in reverse order - let the rank of position during traversal be defined such that the first element visited has rank the second element visited has rank and so on for each position in tree let pre(pbe the rank of in preorder traversal of let post(pbe the rank of in postorder traversal of let depth(pbe the depth of pand let desc(pbe the number of descendants of pincluding itself derive formula defining post(pin terms of desc( )depth( )and pre( )for each node in - design algorithms for the following operations for binary tree preorder next( )return the position visited after in preorder traversal of (or none if is the last node visitedinorder next( )return the position visited after in an inorder traversal of (or none if is the last node visitedpostorder next( )return the position visited after in postorder traversal of (or none if is the last node visitedwhat are the worst-case running times of your algorithmsc- to implement the preorder method of the linkedbinarytree classwe relied on the convenience of python' generator syntax and the yield statement give an alternative implementation of preorder that returns an explicit instance of nested iterator class (see section for discussion of iterators - algorithm preorder draw draws binary tree by assigning xand ycoordinates to each position such that (pis the number of nodes preceding in the preorder traversal of and (pis the depth of in show that the drawing of produced by preorder draw has no pairs of crossing edges redraw the binary tree of figure using preorder draw - redo the previous problem for the algorithm postorder draw that is similar to preorder draw except that it assigns (pto be the number of nodes preceding position in the postorder traversal - design an algorithm for drawing general treesusing style similar to the inorder traversal approach for drawing binary trees - exercise - described the walk function of the os module this function performs traversal of the implicit tree represented by the file system read the formal documentation for the functionand in particular its use of an optional boolean parameter named topdown describe how its behavior relates to tree traversal algorithms described in this