Pergunta de entrevista da empresa Amazon

Code for finding if two trees are identical and get the binary tree given inorder and preorder traversals. Prove unique tree exists if given inorder and either of preorder and postorder. Time and space complexitites of the code written.