Solve "PreOrder and inOrder" traversal