GATE | CS | 2025 | Set 2 | Algorithms | Complexity Analysis | Question 38

Last Updated :
Discuss
Comments

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 𝑛 of these data structures?

P: Θ(1), Q: Θ(𝑛), R: Θ(𝑛)

P: Θ(1), Q: Θ(𝑛 log 𝑛), R: Θ(𝑛)

P: Θ(𝑛), Q: Θ(𝑛 log 𝑛), R: Θ(𝑛 2 )

P: Θ(1), Q: Θ(𝑛), R: Θ(𝑛 log 𝑛)

Share your thoughts in the comments