w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
implementation of binary heap through array

Look both are different: 1. When you are inserting one by one : Basically you are inserting in Binary tree which is already a heap and call heapify 2. When you are inserting everything in an array at once and then making it heap altogether then you are not using heapify (BuildHeap function). Because that is not already a heap.

//Heapify is used when you are inserting in an array which is already a heap

read this : read this

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.