root node( root insert( root insert( root insert( root printtree(when the above code is executedit produces the following result traversing tree the tree can be traversed by deciding on sequence to visit each node as we can clearly see we can start at node then visit the left sub-tree first and right sub-tree next or we can also visit the right sub-tree first and left sub-tree next accordinglythere are different names for these tree traversal methods tree traversal algorithms traversal is process to visit all the nodes of tree and may print their values too becauseall nodes are connected via edges (linkswe always start from the root (headnode that iswe cannot randomly access node in tree there are three ways which we use to traverse tree in-order traversal pre-order traversal post-order traversal in-order traversal in this traversal methodthe left subtree is visited firstthen the root and later the right sub-tree we should always remember that every node may represent subtree itself in the below python programwe use the node class to create place holders for the root node as well as the left and right nodes thenwe create an insert function to add data to the tree finallythe in-order traversal logic is implemented by creating an empty list and adding the left node first followed by the root or parent node at last the left node is added to complete the in-order traversal please note that this process is repeated for each sub-tree until all the nodes are traversed class nodedef __init__(selfdata)self left none