Question discussion

Consider the following new-order strategy for traversing a given tree.I. Visit the right subtree of a Node using new-orderII. Visit the Nod…

360019Medium DSSSB TGT Computer Science 0 replies 0 views
0
Consider the following new-order strategy for traversing a given tree.
I. Visit the right subtree of a Node using new-order
II. Visit the Node
III. Visit the left subtree of a Node using new-order What is the new-order traversal of the given tree?

Figure for question 115

  • AZ, V, Y, X, W, P, S, U, T, Q, R
  • BR, Q, T, U, S, P, W, X, Y, V, Z
  • CP, W, X, Y, V, Z, R, Q, T, U, S
  • DS, U, T, Q, R, Z, V, Y, X, W, P
Correct answer: A

Explanation

The new-order traversal is right subtree, node, left subtree (a reverse in-order). For the given tree this gives Z, V, Y, X, W, P, S, U, T, Q, R.

Discussion 0

Nobody has replied yet. Start the discussion!