Discussion
The post order traversal of a binary tree is DEBFCA. Find out the preorder traversal.
Answer: C
The preorder traversal is ABDECF.
In a postorder traversal the root comes last, so DEBFCA has A as the root. The nodes before it split into the left and right subtrees. B comes after D and E and before F and C, so B is the root of the left subtree with D and E as its children, and C is the root of the right subtree with F as its child.
\[ \text{Preorder} = A\,B\,D\,E\,C\,F \]
Option (A), ABFCDE, and option (B), ADBFEC, do not match the shape given by the postorder, and (D) is wrong since ABDECF is among the options.
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