Binary Min/Max Heap Insert Overview

Published: 30 March 2019
on channel: NoobCoder
65,819
766

In this tutorial we're going to be going over how we can insert data within our binary heap. The first step is always to insert at the last available position within our heap. The 2nd step depends on whether or not we're implementing a min or max heap. For a minimum heap we compare the data we just inserted, to its parents. If its smaller than the parent, we just swap. We continue to do this, up until the root node. The same is true for a maximum heap, except in reverse. We compare the data we just inserted, to its parent. If its greater than its parent, we swap. We continue to do this, up until the root node.


On this page of the site you can watch the video online Binary Min/Max Heap Insert Overview with a duration of hours minute second in good quality, which was uploaded by the user NoobCoder 30 March 2019, share the link with friends and acquaintances, this video has already been watched 65,819 times on youtube and it was liked by 766 viewers. Enjoy your viewing!