diff --git a/zip-0221.rst b/zip-0221.rst index 6dceacf8..1611cdd5 100644 --- a/zip-0221.rst +++ b/zip-0221.rst @@ -66,7 +66,7 @@ and only requires knowledge of the previous subtree roots, of which there are fe To illustrate this, consider a list of 11 leaves. We first construct the biggest perfect binary subtrees possible by joining any balanced sibling trees that are the same size. We do this starting from the left to the right, adding a parent as soon as 2 children exist. -This leaves us with three subtrees ("mountains") of heights 3, 1, and 0: +This leaves us with three subtrees ("mountains") of altitudes 3, 1, and 0: .. code-block:: C @@ -80,7 +80,7 @@ order of insertion: .. code-block:: C - Height + Altitude 3 14 / \ @@ -98,7 +98,7 @@ and represent this numbering in a flat list: .. code-block:: python Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 - Height 0 0 1 0 0 1 2 0 0 1 0 0 1 2 3 0 0 1 0 + Altitude 0 0 1 0 0 1 2 0 0 1 0 0 1 2 3 0 0 1 0 This allows us to easily jump to the right sibling of a node by adding ``2^(h+1) - 1`` to its position, and its left child by subtracting ``2^h``. This allows us to efficiently @@ -112,7 +112,7 @@ algorithm: .. code-block:: C - Height + Altitude 5 20 / \