Test creation of a tree from its preorder and inorder traversal