title: Given a tree traversal order find out whether it is preorder inorder or postorder
body: <p>Assuming that someone gives me a tree traversal order for the nodes from A to G - F, B, A, D, C, E, G, I, H which can be either preorder, inorder or postorder</p>
  
  <ol>
  <li>How can I determine whether its preorder, inorder or postorder efficiently?</li>
  <li>How do I reconstruct the tree efficiently without having to construct the tree for each of the three traversal types like the one shown below?</li>
  </ol>
  
  <p><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Sorted_binary_tree_preorder.svg/220px-Sorted_binary_tree_preorder.svg.png" alt="Sample tree"></p>