Binary Heap

In a binary max heap containing n n numbers, the smallest element can be found in what time?

O ( 1 ) O(1) O ( n log n ) O(n\log n) O ( log n ) O(\log n) O ( n ) O(n)

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Anil Ram
Dec 16, 2015

Max heap: The value of a node must be greater than or equal to the values of its children.

In Max Heap, Always smallest elements goes to leaf nodes,so in worst case we need to traverse all the elements.

further info : http://www.dgp.utoronto.ca/people/JamesStewart/378notes/08buildheap/

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...