Why 'Flat is better than nested'

Ian Kelly ian.g.kelly at gmail.com
Tue Jul 31 23:49:05 CEST 2012


On Tue, Jul 31, 2012 at 3:28 PM, Ifthikhan Nazeem <iftecan2000 at gmail.com> wrote:
> as many as (about) 2*N - log2(N) parent child relationships
>
> I would like to know how did you come up with the above formula? Forgive my
> ignorance.

I come up with 2N - 2 myself.  If there are N leaf nodes and N - 1
non-leaf nodes, then there are 2N - 1 total nodes, each of which has
one parent except for the root.  That's 2N - 2 parent-child
relationships.



More information about the Python-list mailing list