From the following code identify the which traversal of a binary tree is this…

2025

From the following code identify the which traversal of a binary tree is this __________

//if node has left child

order(node.left)

//if node has right child

order(node.right)

visit(node)

  1. A.

    Inorder traversal

  2. B.

    preorder traversal

  3. C.

    postorder traversal

  4. D.

    Euler tour traversal

Attempted by 216 students.

Show answer & explanation

Correct answer: C

Answer: c

Explanation: In a postorder traversal of a binary tree first is to traverse the left subtree, second traverse the right subtree of the tree and third is to visit the node.

Explore the full course: Coding For Placement