A binary tree is left-complete of height h if all possible nodes of depth h-1 are present and all nodes at depth h are in the leftmost possible positions
size, complete binary tree
1 0
2 0
/
1
3 0
/ \
1 2
4 0
/ \
1 2
/
3
6 0
/ \
1 2
/ \ /
3 4 5
7 0
/ \
1 2
/ \ / \
3 4 5 6
10 _ 0 _
/ \
1 2
/ \ / \
3 4 5 6
/ \ /
7 8 9
15 _ 0 _
/ \
1 2
/ \ / \
3 4 5 6
/ \ /\ / \ / \
7 8 9 10 11 12 13 14
16 ________ 0 _______
/ \
__ 1 __ __ 2 __
/ \ / \
3 4 5 6
/ \ / \ / \ / \
7 8 9 10 11 12 13 14
/
15
31 ________ 0 _______
/ \
__ 1 __ __ 2 __
/ \ / \
3 4 5 6
/ \ / \ / \ / \
7 8 9 10 11 12 13 14
/ \ / \ / \ / \ / \ / \ / \ / \
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Height, range of sizes
-1 0..0
0 1..1
1 2..3
2 4..7
3 8..15
4 16..31
5 32..63
6 64..127
7 128..255
8 256..511
9 512..1023
10 1024..2047
11 2048..4095
12 4096..8191
13 8192..16383
14 16384..32767
15 32768..65537
16 65536..131071
17 131072..262143
18 262144..523287
19 524288..1048575
20 1048576..(2 million +)
..
30 (1 billion +)..(2 billion +)
h (2h) .. (2*2h - 1)