OT: Binary tree logarithms properties

Mr.SpOOn mr.spoon21 at gmail.com
Thu Dec 18 05:34:42 EST 2008


2008/12/17 Terry Reedy <tjreedy at udel.edu>:
> Nodes only have single number indexes if you arrange them linearly. Then the
> index depends on how you arrange them, whether you start the array indexes
> with 0 or 1, and whether you start the level numbers with 0 or 1.  Call the
> breadth-first sequence bf.  Then the 1-based slice for 1-first level k is
> bf[2**(k-1):2**k)].  Again, proof by induction.

Yes, I was referring to the heap numeration.
Anyway, Francesco Guerrieri answered me in a private message and
explained me the formula.

But actually I was searching for other similar properties.



More information about the Python-list mailing list