1.

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 IThe question was posed to me during an online interview.

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).



Discussion

No Comment Found

Related InterviewSolutions