From 108b640c228b10ef41d37159316b10842c6a6c17 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Tue, 10 Sep 2019 18:50:10 +0300 Subject: [PATCH] Update mmr.md (#3024) --- doc/mmr.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/mmr.md b/doc/mmr.md index 62bd9b4ba..fcdcf3af9 100644 --- a/doc/mmr.md +++ b/doc/mmr.md @@ -94,6 +94,8 @@ total size). We process iteratively for a MMR of size 11: 2^4 - 1 = 15, and 15 is not < 11 ``` +(This can also be calculated non-iteratively as `2^(binary logarithm of size + 1) - 1` + Therefore the first peak is 7. To find the next peak, we then need to "jump" to its right sibling. If that node is not in the MMR (and it won't), take its left child. If that child is not in the MMR either, keep taking its left child