+1 vote
in Data Structures & Algorithms I by (88.2k points)
The worst case analysis for a naïve merge is given as?

(a) O(N)

(b) O( log N)

(c) O( N log N)

(d) O(N^2)

This interesting question is from Heap in portion Heap of Data Structures & Algorithms I

The question was posed to me during an online interview.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
Right choice is (a) O(N)

To explain: The worst-case analysis for the naïve merge is an insertion in a right heavy tree. So, insertion takes O(N).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.