Medium

Heap Operations

Heapify walks the array from the middle backward and sifts each subtree down. That build is linear, which is tighter than inserting n items one by one.

Costs

CategoryAlgorithm
DifficultyMedium
Build a heapO(n)
Sift up or sift downO(log n)
Insert n items one by oneO(n log n)

Questions

What is Heap Operations?

Heapify walks the array from the middle backward and sifts each subtree down. That build is linear, which is tighter than inserting n items one by one.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.