mirror of https://github.com/zcash/zips.git
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:
parent
9eee0edd0c
commit
bf159d1221
|
@ -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
|
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
|
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.
|
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
|
.. code-block:: C
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ order of insertion:
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: C
|
||||||
|
|
||||||
Height
|
Altitude
|
||||||
|
|
||||||
3 14
|
3 14
|
||||||
/ \
|
/ \
|
||||||
|
@ -98,7 +98,7 @@ and represent this numbering in a flat list:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
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
|
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
|
its position, and its left child by subtracting ``2^h``. This allows us to efficiently
|
||||||
|
@ -112,7 +112,7 @@ algorithm:
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: C
|
||||||
|
|
||||||
Height
|
Altitude
|
||||||
|
|
||||||
5 20
|
5 20
|
||||||
/ \
|
/ \
|
||||||
|
|
Loading…
Reference in New Issue