Use "altitude" to measure peaks instead of "height"

"Height" is used elsewhere in the ZIP to refer to block heights.
This commit is contained in:
Jack Grigg 2020-03-04 17:42:47 +13:00 committed by Daira Hopwood
parent 9eee0edd0c
commit bf159d1221
1 changed files with 4 additions and 4 deletions

View File

@ -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
/ \