GATE CS 2008 · Arrays & Matrix Representation

MCQ · 2 marks · Problem PROG-DSTR-0191

You are given the postorder traversal, P, of a binary search tree on the n elements 1, 2,...,n. You have to determine the unique binary search tree that has P as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this?
  1. A
    \(\Theta\) (logn)
  2. B
    \(\Theta\) (n)
  3. C
    \(\Theta\) (nlogn)
  4. D
    None of the above, as the tree cannot be uniquely determined

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/458/gate2008-46

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com