Build Heap Algorithm | Proof of O(N) Time Complexity

0 Comments

This video explains the build heap algorithm with example dry run.In this problem, given an array, we are required to build a heap.I have shown all the observations and intuition needed for solving the problem.I have shown all the prerequisite concepts required to solve the problem as well using examples.We can use the heapify algorithm to do this which takes just O(N) time complexity.I have shown how to build a max heap using max heapify algorithm using example and you can also follow the same procedure to build a min heap using min heapify algorithm.At the end, I have also shown the mathematical proof of time complexity.