This implementation is inspired by a homework assignment from 15-213 at Carnegie Mellon University. It is intended for educational purposes only and is not suitable for production use. A simple naive ...
Here we have an array of integers and starting at index 0 we have our root. The left child of the index 0 is index 1 and the right child is index 2. Using the formula above we can simply find the ...