Question discussion

Preorder traversal of binary search tree is 38, 14, 8, 23, 18, 20, 56, 45, 82, 70. What is the postorder traversal of binary search tree?

359869Medium DSSSB TGT Computer Science 0 replies 0 views
0

Preorder traversal of binary search tree is 38, 14, 8, 23, 18, 20, 56, 45, 82, 70. What is the postorder traversal of binary search tree?

  • A23, 20, 18, 14, 8, 38, 45, 56, 70, 82
  • B82, 70, 56, 45, 38, 23, 20, 18, 14, 8
  • C8, 18, 20, 23, 14, 45, 70, 82, 56, 38
  • D8, 20, 18, 23, 14, 45, 70, 82, 56, 38
Correct answer: D

Explanation

Preorder 38, 14, 8, 23, 18, 20, 56, 45, 82, 70 builds a BST with 38 as root. Postorder (left, right, root) is 8, 20, 18, 23, 14, 45, 70, 82, 56, 38.

Discussion 0

Nobody has replied yet. Start the discussion!