Discussion
The pre-order and post-order traversal of a binary tree generates the same output. The tree can have maximum :
Answer: C
The tree can have at most one node.
Pre-order visits the root first and then its subtrees; post-order visits the subtrees first and the root last. In any tree with two or more nodes, the root is the first node of the pre-order output but the last node of the post-order output, so the two sequences differ.
Only a tree with a single node, where the root is both first and last, gives the same output in both traversals. So two nodes, three nodes and any number of nodes are all wrong.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development