GATE CS 2025 · Set 2 · Linked Lists

MCQ · 1 mark · Problem PROG-DSTR-0065

A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures: P: Unsorted doubly linked list with pointers to the head node and tail node of the list.Q: Min-heap implemented using an array.R: Binary Search Tree.Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size \(n\) of these data structures?
  1. A
    P: \(\Theta(1)\), Q: \(\Theta(n)\), R: \(\Theta(n)\)
  2. B
    P: \(\Theta(1)\), Q: \(\Theta(n \log n)\), R: \(\Theta(n)\)
  3. C
    P: \(\Theta(n)\), Q: \(\Theta(n \log n)\), R: \(\Theta(n^2)\)
  4. D
    P: \(\Theta(1)\), Q: \(\Theta(n)\), R: \(\Theta(n \log n)\)

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

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/460807/gate-cse-2025-set-2-question-28

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