adplus-dvertising
frame-decoration

Question

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

a.

O(n*n*logn)

b.

O(n*logn)

c.

O(n*n)

d.

O(n *logn *logn)

Answer: (b).O(n*logn)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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