I'm researching the topic of succinct tree representations right now and came across this presentation. On slide 17 there is an example of heap-like notation of a BST (using BFT bit-vectors) and the author claims that the amount of bits needed to represent a tree of $n$ elements (without their values) is exactly $2n+1$.
According to my calculations, it's $2n-1$. Here they are:
- As in this representation every BST is represented as a complete tree, for the complete tree of height $k$ it has $2^{k+1}-1$ nodes.
- On average for $n$ nodes tree has a height of $log_2n$.
- Replacing the $k$ from the first list item with the average BST height from the second list item I received:
$$2^{log_2n+1}-1=2n-1$$
What am I missing in my calculations? Where do these 2 extra bits come from?
Thanks in advance for your answer!