GATE CS 2016, set 2 · Question 25 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer
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: Θ(N) delete , O(log N) insert , O(log N) find , and Θ(N) decrease-key . What is the time complexity of all these operations put together?
- (A) O(log² N)
- (B) O(N)
- (C) O(N²)
- (D) Θ(N² log N)
Answer
Answer (C)
Answer from the official GATE CS 2016 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes