consider the tree given in fig the pre-order traversal of the tree is given as abc root node firstthe left sub-tree nextand then the right sub-tree pre-order traversal is also called as depth-first traversal in this algorithmthe left sub-tree is always traversed before the right sub-tree the word 'prein the pre-order specifies that the root node is accessed prior to any other nodes in step repeat steps to while tree !null the left and right sub-trees pre-order algorithm step write tree -data is also known as the nlr traversal algorithm step preorder(tree -leftstep preorder(tree -right(node-left-rightthe algorithm for pre-order [end of looptraversal is shown in fig step end pre-order traversal algorithms are used to extract prefix notation from an expression tree for exampleconsider the expressions given below when we traverse the elements of tree using the pre-order traversal algorithmthe expression that we get is prefix expression figure algorithm for pre-order traversal (from fig (from fig of example (from fig of example traversal orderabdghlecfijand traversal orderabdcdefghand (ah (bexample in figs (aand ( )find the sequence of nodes that will be visited using pre-order traversal algorithm solution in-order traversal to traverse non-empty binary tree in in-orderthe following operations are performed recursively at each node the algorithm works by traversing the left sub-tree visiting the root nodeand finally traversing the right sub-tree consider the tree given in fig the in-order traversal of the tree is given as baand left sub-tree firstthe root node nextand then the right sub-tree in-order traversal is also called as symmetric traversal in this algorithmthe left sub-tree is always traversed before the root node and the right sub-tree the word 'inin the in-order specifies that the root node is accessed in between the left and the right sub-trees in-order algorithm is also known as the lnr traversal algorithm (left-node-rightthe algorithm for in-order traversal is shown in fig step repeat steps to while tree !null step inorder(tree -leftstep write tree -data step inorder(tree -right[end of loopstep end figure algorithm for in-order traversal in-order traversal algorithm is usually used to display the elements of binary search tree hereall the elements with value lower than given value are accessed before the elements with higher value we will discuss binary search trees in detail in the next