inorder/preorder traversal and anagrams