What is the result of a post-order traversal on a binary tree with nodes 1, 2, and 3, where 1 is the root, 2 is the left child, and 3 is the right child?
Practice Questions
1 question
Q1
What is the result of a post-order traversal on a binary tree with nodes 1, 2, and 3, where 1 is the root, 2 is the left child, and 3 is the right child?
1, 2, 3
2, 3, 1
3, 2, 1
1, 3, 2
In post-order traversal, we visit the left child, then the right child, and finally the parent. Thus, the output is 2, 3, 1.
Questions & Step-by-step Solutions
1 item
Q
Q: What is the result of a post-order traversal on a binary tree with nodes 1, 2, and 3, where 1 is the root, 2 is the left child, and 3 is the right child?
Solution: In post-order traversal, we visit the left child, then the right child, and finally the parent. Thus, the output is 2, 3, 1.