Traverse through the first tree until you reach the leftmost element , which is the first element of the tree in the inorder traversal . This is the least element of the tree
while ( temp1 -> left ) { prev1 = temp1 ; temp1 = temp1 -> left ; }