Binary tree
A perfect binary tree can be stored in an array by putting the nodes in level order: the root at index 0, its children at 1 and 2, its grandchildren from 3 to 6. With that order a formula appears: if a node is at index i, its left child is at 2i + 1 and its right child at 2i + 2. The formulas do the references' job: there's no need to store what each node points to.
With the same formulas, you can also go from a child to its parent: index i's parent is at (i − 1) / 2, rounded down. That way you can move up and down the tree with just math. This is used a lot in heaps, which store their tree in an array and move elements up and down all the time.
The formulas work if the tree is full. If it's missing nodes in the middle, storing it by levels shifts the spots and the formulas stop pointing to the right child. The fix is to store the gaps too: where a node is missing, put None. That way each node lands at the index it should, and the array identifies the tree without ambiguity.
Storing a tree in an array has advantages: memory is contiguous, so it's cache-friendly and fast to walk; no references need storing, which saves space; and you can reach any node by its index. And it has limits: it needs a big block of adjacent memory, inserting and deleting in the middle is expensive, and if the tree has many gaps, space is wasted.
