Discussion
Which tree traversal visits root first, then left, then right ?
Answer: D
Root first, then left, then right is preorder traversal.
The three depth-first traversals of a binary tree are named after where the root is visited. Preorder visits the root before its subtrees (root, left, right), inorder visits it between them (left, root, right), and postorder visits it after them (left, right, root).
Level order is breadth-first: it visits the nodes level by level from the top, left to right, using a queue, rather than following the root-left-right pattern.
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