GATE Papers >> CSE >> 2016 >> Question No 125

Question No. 125 CSE | GATE 2016
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(logN) insert, O(logN) find, and ΘN decrease-key. What is the time complexity of all these operations put together?

Answer : (C) O(N2)

Solution of Question No 125 of GATE 2016 CSE Paper
Data Structure used Find Insert Delete Decrease key Overall asymptotic time
Sorted doubly linked list O(N logN) O(N logN) O(N) O(N) O(N logN)

Sorted doubly linked list take maximum of of O(N logN) time, but since not present in option.

So, go for nearest value O(N2).

jefGbF levitra nizagara

Posted on  18/10/2020 17:50:55  by  dobsonz
Leave a comment