Create two vectors and store inorder traversals of both BSTs in them .
List < int > v1 = new List < int > ( ) ; List < int > v2 = new List < int > ( ) ; storeInorder ( root1 , v1 ) ; storeInorder ( root2 , v2 ) ;