If you know any two of the three tree traversals (preorder, inorder, postorder), you can construct the AVL
tree. Since AVL
tree is a BST
, inorder is known. So, store any of postorder or preorder in the file. From that, you can construct the whole tree.
See about tree-traversal.
And also how to construct tree from inorder and preorder traversals.