In what time can a leftist heap be built?

Category: QuestionsIn what time can a leftist heap be built?
Editor">Editor Staff asked 1 month ago

In what time can a leftist heap be built?
 
(a) O(N)
 
(b) O(N log N)
 
(c) O(log N)
 
(d) O(M log N)
 
The query is from Heap topic in portion Heap of Data Structures & Algorithms I
 
The question was asked in a job interview.

1 Answers
Editor">Editor Staff answered 1 month ago

Right choice is (a) O(N)
 
Best explanation: The mathematical calculation yields a result that, a leftist heap can be built in O(N) time by building a binary heap.