Binary heap tree proof: index of left child is doubled index of parent + 1
January 2022
We can often see, that i_left_child = i_parent * 2 + 1. And even though this formula is easy to check, it’s quite hard to believe in it, without a formal proof. I made an image that proofs this quite commonly used in computer science fact.
A longer read with a bit more formal proof:
Inspired by my post on CS stack exchange. The original vector image was created with diagrams.net/draw.io.
Leave a Reply