An array consists of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of

An array consists of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of Correct Answer O(n*logn)

The total time taken will be N times the complexity of adding a single element to the heap. And adding a single element takes logN time, so That is equal to N*logN.
Bissoy MCQ

Related Questions

You want to provide complete redundancy for all data stored on your hardware RAID 5 array. You install second h/w Raid 5. You want to create a mirror set of the original array. However when you right click the free space on new array you see no option to create a new volume or mirrrored volume. What should you do?
Statement 1: In insertion sort, after m passes through the array, the first m elements are in sorted order. Statement 2: And these elements are the m smallest elements in the array.