Computer Science, asked by sanjeevanand9604, 1 year ago

Which of the following tree traversal visits root node last?
1) inorder
2) preorder
3) postorder
4) None of the above

Answers

Answered by sneha8665
17

Option 3.

Plz mark me as the brainliest.

Answered by halamadrid
0

In post-order tree traversal, the root node is visited last. (option 3)

  • The binary tree is the non-linear type data structure where the data items are not organized sequentially.
  • Hence, we can't traverse a binary tree, like we traverse a linked list or arrays where the data are organized sequentially, but it requires a different approach.
  • The traversal of the binary tree simply involves visiting each node of the tree exactly once.
  • There are commonly three methods that are used for traversal of binary trees i.e. In-order traversal, pre-order traversal, post-order traversal.
  • For traversing a non-empty binary tree in post order, we need to perform a particular three operations in the following order:
  1. Traverse or visit the left sub-tree in post-order.
  2. Traverse or visit the right sub-tree in post-order.
  3. Root node is visited last.

Similar questions