Tree Traversal
1. How is traversal of a tree different from traversal of a general graph?
2. We can uniquely reconstruct a binary tree with distinct node values using the results of which traversals?
3. To find the shortest distance in terms of number of edges from a starting vertex to every reachable vertex in an unweighted graph, which traversal can be used?
4. Let us assume a binary tree consisting of nodes a, b, c, d, e, f, g. If the postorder traversal on the tree gives {d, e, b, f, g, c, a}, then what are the preorder and inorder traversals respectively?
5. Consider a binary tree with root A, left child B, and right child C. B has children D and E. What is the level-order traversal?
6. Which traversal of a binary tree visits the root after both its left and right subtrees?
7. If a binary tree has nodes, what is the time complexity of preorder traversal when every node is visited exactly once?
8. Which traversal is most directly associated with a queue in its standard iterative implementation?
9. Consider a binary tree with root A, left subtree rooted at B, and right subtree rooted at C. B has children D and E, while C has children F and G. Which sequence is the postorder traversal?