GATE CS 2016 · Set-2 · Asymptotic Analysis & Recurrences

MCQ · 1 mark · Problem PROG-DIVC-0182

N items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in this order: \(\Theta(N) \; delete\) , \(O(logN) \; insert\), \(O(logN) \; find\), and \(\Theta(N) \; decrease-key\). What is the time complexity of all these operations put together?
  1. A
    \(O(log^{2}N)\)
  2. B
    O(N)
  3. C
    \(O(N^{2})\)
  4. D
    \(\Theta (N^{2} logN)\)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/39557/gate2016-2-15

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