ELI5: Explain Like I'm 5

Binary heap

A binary heap is like a big pile of toys, but each toy has a number on it. The pile is sorted so the biggest toy (the one with the highest number) is on top, and the smaller toys are further down.

When you want to add a new toy, you put it at the very bottom of the pile. Then you swap it with its parent toy until it's in the right spot, meaning that it has a bigger number than its parent toy.

When you want to remove a toy, you take the one on top and put the one at bottom. Then you take the bottom toy and swap it with its children until it meets the correct pairing criteria with its parents to make a new top toy.

Binary heap piles are very useful in computer programming, because they help organize data and make it easy to find items quickly. Just like when you want to find your favorite toy in a big pile, you can quickly look at the topmost toy in the heap to find the biggest or smallest number.