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