Concept Flow - Why Heap Exists and What Sorted Array Cannot Do Efficiently
Start with Sorted Array
Insert Element
Must Shift Elements to Keep Sorted
Insertion is Slow
Need Faster Insert
Use Heap Structure
Insert at End
Heapify Up to Maintain Order
Fast Insert and Extract Min/Max
Shows why inserting in a sorted array is slow due to shifting, leading to the heap which allows fast insert and extract operations.
