Create two stacks for preorder traversals
Stack < Node > s1 = new Stack < Node > ( ) ; Stack < Node > s2 = new Stack < Node > ( ) ; s1 . push ( root1 ) ; s2 . push ( root2 ) ; while ( ! s1 . isEmpty ( ) || ! s2 . isEmpty ( ) ) {