Talk:TADM2E 4.12

From Algorithm Wiki
Revision as of 01:38, 21 November 2019 by Landisdesign (talk | contribs) (Created page with "It seems to me the first option (find smallest, move to top, extract k-1) wouldn't work, because using heapify assumes the heaps below the current are well-formed. That's why...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

It seems to me the first option (find smallest, move to top, extract k-1) wouldn't work, because using heapify assumes the heaps below the current are well-formed. That's why using heapify from the bottom up works, because the leaves are valid heaps. This first approach attempts to build the heap from the top down without having a valid heap to start.