UGC-NET Jun 2012 · Trees

MCQ · 2 marks · Problem PROG-DSTR-0048

To represent hierarchical relationship between elements, which data structure is suitable?
  1. A
    Dequeue
  2. B
    Priority
  3. C
    Tree
  4. D
    All of the above

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

Show the worked solutionA tree has a root and each node has one parent and any number of children, which models hierarchies such as file systems, organisation charts and class inheritance.(A) A deque is a linear sequence — incorrect.(B) A priority queue orders by key, not by parent-child relationship — incorrect.(D) Only the tree fits — incorrect.Answer: C

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