Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26328 > unrolled thread

Re: Why 'Flat is better than nested'

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-07-31 15:49 -0600
Last post2012-07-31 15:49 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Why 'Flat is better than nested' Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-31 15:49 -0600

#26328 — Re: Why 'Flat is better than nested'

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-07-31 15:49 -0600
SubjectRe: Why 'Flat is better than nested'
Message-ID<mailman.2797.1343771377.4697.python-list@python.org>
On Tue, Jul 31, 2012 at 3:28 PM, Ifthikhan Nazeem <iftecan2000@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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web