[algogeeks] Re: Building a max heap takes O(n) time irrespective of the array being sorted / unsorted.

2011-09-15 Thread Ankuj Gupta
is talks of more tighter bound of O(nlogn) On Sep 15, 11:24 pm, sunny agrawal sunny816.i...@gmail.com wrote: Read CLRS On Thu, Sep 15, 2011 at 11:51 PM, saurabh agrawal saurabh...@gmail.comwrote: Building a max heap takes O(n) time irrespective of the array being sorted / unsorted.

Re: [algogeeks] Re: Building a max heap takes O(n) time irrespective of the array being sorted / unsorted.

2011-09-15 Thread Terence
http://en.wikipedia.org/wiki/Binary_heap#Building_a_heap The algorithm of heap-building presented in most books is O(n). On 2011-9-16 12:52, Ankuj Gupta wrote: is talks of more tighter bound of O(nlogn) On Sep 15, 11:24 pm, sunny agrawalsunny816.i...@gmail.com wrote: Read CLRS On Thu,