We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There is an algorithm, invented by Floyd, that heapifies'' an array in O(n). It does it in a bottom-up manner, if you just insert each of the elements in a heap one by one of course it's O(n log n).
A Basic Quiz on Algorithms #1
You are viewing a single comment's thread. Return to all comments →
There is an algorithm, invented by Floyd, that heapifies'' an array in O(n). It does it in a bottom-up manner, if you just insert each of the elements in a heap one by one of course it's O(n log n).
http://www.cs.umd.edu/~meesh/351/mount/lectures/lect14-heapsort-analysis-part.pdf