for in range( )found tree search(iprint("{}{}format(ifound)tree traversal visiting all the nodes in tree can be done depth first or breadth first these modes of traversal are not peculiar to only binary search trees but trees in general depth-first traversal in this traversal modewe follow branch (or edgeto its limit before recoiling upwards to continue traversal we will be using the recursive approach for the traversal there are three forms of depth-first traversalnamely in-orderpre-orderand post-order in-order traversal and infix notation most of us are probably used to this way of representing an arithmetic expressionsince this is the way we are normally taught in schools the operator is inserted (infixedbetween the operandsas in when necessaryparentheses can be used to build more complex expression( ( in this mode of traversalyou would visit the left sub-treethe parent nodeand finally the right sub-tree the recursive function to return an in-order listing of nodes in tree is as followsdef inorder(selfroot_node)current root_node if current is nonereturn self inorder(current left_childprint(current dataself inorder(current right_childwe visit the node by printing the node and making two recursive calls with current left_child and current right_child