algorithm findmax(root preroot is the root node of the bst root postthe largest value in the bst is located if root right return root value end if findmax(root right end findmax tree traversals there are various strategies which can be employed to traverse the items in treethe choice of strategy depends on which node visitation order you require in this section we will touch on the traversals that dsa provides on all data structures that derive from binarysearcht ree preorder when using the preorder algorithmyou visit the root firstthen traverse the left subtree and finally traverse the right subtree an example of preorder traversal is shown in figure algorithm preorder(root preroot is the root node of the bst postthe nodes in the bst have been visited in preorder if root yield root value preorder(root left preorder(root right end if end preorder postorder this algorithm is very similar to that described in sshowever the value of the node is yielded after traversing both subtrees an example of postorder traversal is shown in figure algorithm postorder(root preroot is the root node of the bst postthe nodes in the bst have been visited in postorder if root postorder(root left postorder(root right yield root value end if end postorder