Which of the following represents postorder traversal of a binary tree?
Explanation
Correct Option: (C) Left → Right → Root
Explanation
Tree traversal is the process of visiting each node in a tree data structure exactly once. Postorder traversal is a type of depth-first traversal where the order of operations is defined as follows:
Left Subtree: Recursively visit the left child.
Right Subtree: Recursively visit the right child.
Root Node: Finally, visit the root node.
The order can be represented by the following logic:
Postorder(node)=Postorder(node.left)+Postorder(node.right)+node.value