4/40
Part 2 of 8 · The heapLearn and do

The tree lives in a plain list

A heap is a tree, but it has no node objects. The tree is the list, read by index.

The children of index i sit at 2i + 1 and 2i + 2

Predict

In the list [7, 12, 18, 30, 21, 45, 60], index i has its children at 2i + 1 and 2i + 2. What are the children of 12, at index 1?

Pick an answer above to see the rest