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


Groups > comp.lang.c > #60257

Re: primitive instruction for programming

From Steve Thompson <stevet810@gmail.com>
Newsgroups comp.lang.c
Subject Re: primitive instruction for programming
Date 2015-04-17 19:06 +0000
Organization Friends of the Galactic Collective
Message-ID <81W7iB.TWT.FKGxq@gmail.com> (permalink)
References (3 earlier) <mgg66h$u4r$1@dont-email.me> <hLTsJW.t1p.ffTNE@gmail.com> <kfnr3rkys8d.fsf@x-alumni2.alumni.caltech.edu> <263NCi.tYn.6s7aE@gmail.com> <7fde0524-8c3d-4ff5-95a7-b0a781881191@googlegroups.com>

Show all headers | View raw


On Fri, Apr 17, 2015 at 08:34:07AM -0700, Malcolm McLean wrote:
> On Friday, April 17, 2015 at 3:35:46 PM UTC+1, Steve Thompson wrote:
> > On Thu, Apr 16, 2015 at 09:04:34AM -0700, Tim Rentsch wrote:
> > 
> > >     void
> > >     inorder_print( Tree root ){
> > >         Tree *stack = malloc( 100 * sizeof *stack );
> > 
> > A balanced binary tree with a depth of 90 will easily exceed the
> > number of nodes one might hope to address with a 64-bit address space.
> > If the tree is unbalanced you should guard against stack overflow or
> > make sure that your insert/delete functions catch this.
> > 
> The human/chimp split was about 5 million years ago.
> A generation is about 20 years, and the population was low by modern standards 
> until the development of agriculture, maybe 10,000 year ago.
> So let's say 250,000 generations with a population of 100,000, and
> 200 generations with a population of 1 billion, plus 10 billion for the 20th
> century. 
> 250,000 * 100,000 + 200 * 1,000,000,000 + 10,000,000,000
> 
> 25 billion + 200 billion + 10 billion = 235 billion, so we need about a
> terabyte of memory to store a tree consisting of every human who ever lived.
> That's a bit expensive, but not unfeasible, we could build such a computer
> for low millions of dollars.
> 
> Now my parents and grandparents are a perfectly balanced binary tree with one
> female and one male entry at each node, and we can hold it in memory.
> But the depth is 250,000 until you come to chimpanzees.

I am failing to grasp your point, although I confess that I have not
tried very hard.

2^90 is 1 237 940 039 285 380 274 899 124 224, a quantity that is
slightly more than 235 billion.

Just to confuse matters: an AVL tree with depth 90 will hold a minimum
of 12 200 160 415 121 876 737 nodes.  Note that is *minimum*.

(2^64 - 1) = 18 446 744 073 709 551 615




Regards,

Steve Thompson

-- 
"If I had a nickel for every time some idiot called me about a
computer problem that turned out to be user error, I would be able to
retire and spend the rest of my days cultivating clues in my backyard
hillside garden."  -- MysteryDog in 24hoursupport.helpdesk.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 00:56 -0700
  Re: primitive instruction for programming Richard Heathfield <rjh@cpax.org.uk> - 2015-04-13 09:24 +0100
    Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 01:59 -0700
      Re: primitive instruction for programming Richard Heathfield <rjh@cpax.org.uk> - 2015-04-13 10:32 +0100
        Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 02:53 -0700
          Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 11:04 +0100
          Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-13 14:10 +0200
            Re: primitive instruction for programming Emiliano Gomes Padilha <egpadilha@gmail.com> - 2015-04-20 14:27 -0700
              Re: primitive instruction for programming Emiliano Gomes Padilha <egpadilha@gmail.com> - 2015-04-20 15:12 -0700
                Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-21 00:17 +0100
                Re: primitive instruction for programming Emiliano Gomes Padilha <egpadilha@gmail.com> - 2015-04-22 11:07 -0700
              Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-21 09:04 +0200
                Re: primitive instruction for programming Robert Wessel <robertwessel2@yahoo.com> - 2015-04-21 03:02 -0500
                Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-21 01:34 -0700
                Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-21 11:34 +0200
                Re: primitive instruction for programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-21 11:48 +0100
                Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-21 13:10 +0200
                Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-21 10:53 +0100
    Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 20:09 +0100
      Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 12:48 -0700
      Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-14 09:40 +0200
        Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-14 11:24 +0100
          Re: primitive instruction for programming Robert Wessel <robertwessel2@yahoo.com> - 2015-04-14 05:39 -0500
          Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-14 13:29 +0200
  Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 10:59 +0100
    Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 03:28 -0700
      Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 03:33 -0700
        Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 03:59 -0700
          Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 04:23 -0700
      Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 11:36 +0100
        Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 04:26 -0700
          Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 12:41 +0100
            Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 06:26 -0700
              Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-13 15:33 +0200
                Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 06:44 -0700
                Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-13 16:30 +0200
                Re: primitive instruction for programming Ian Collins <ian-news@hotmail.com> - 2015-04-14 07:52 +1200
                Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-14 09:47 +0200
                Re: primitive instruction for programming raltbos@xs4all.nl (Richard Bos) - 2015-04-14 08:10 +0000
                Re: primitive instruction for programming David Brown <david.brown@hesbynett.no> - 2015-04-14 10:40 +0200
        Re: primitive instruction for programming Steve Thompson <stevet810@gmail.com> - 2015-04-13 17:52 +0000
          Re: primitive instruction for programming Robert Wessel <robertwessel2@yahoo.com> - 2015-04-13 18:20 -0500
            Re: primitive instruction for programming Robert Wessel <robertwessel2@yahoo.com> - 2015-04-13 18:33 -0500
              Re: primitive instruction for programming Steve Thompson <stevet810@gmail.com> - 2015-04-14 19:51 +0000
          Re: primitive instruction for programming Tim Rentsch <txr@alumni.caltech.edu> - 2015-04-16 09:04 -0700
            Re: primitive instruction for programming Steve Thompson <stevet810@gmail.com> - 2015-04-17 02:25 +0000
              Re: primitive instruction for programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-04-17 08:34 -0700
                Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-17 17:49 +0100
                Re: primitive instruction for programming Steve Thompson <stevet810@gmail.com> - 2015-04-17 19:06 +0000
                Re: primitive instruction for programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-04-17 20:45 -0700
                Re: primitive instruction for programming Steve Thompson <stevet810@gmail.com> - 2015-04-18 16:43 +0000
                Re: primitive instruction for programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-04-18 09:56 -0700
                Re: primitive instruction for programming Stephen Sprunk <stephen@sprunk.org> - 2015-04-17 17:52 -0500
                Re: primitive instruction for programming Morris Dovey <mrdovey@iedu.com> - 2015-04-17 18:02 -0500
                Re: primitive instruction for programming Stephen Sprunk <stephen@sprunk.org> - 2015-04-17 19:26 -0500
                Re: primitive instruction for programming Morris Dovey <mrdovey@iedu.com> - 2015-04-17 20:04 -0500
                Re: primitive instruction for programming Michael Angelo Ravera <maravera@prodigy.net> - 2015-04-19 14:59 -0700
                Re: primitive instruction for programming Richard Heathfield <rjh@cpax.org.uk> - 2015-04-20 00:19 +0100
                Re: primitive instruction for programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-20 02:06 +0100
                Re: primitive instruction for programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-20 02:26 +0100
                Re: primitive instruction for programming Richard Heathfield <rjh@cpax.org.uk> - 2015-04-20 02:18 +0100
              Re: primitive instruction for programming Tim Rentsch <txr@alumni.caltech.edu> - 2015-04-18 18:59 -0700
                Re: primitive instruction for programming Steve Thompson <stevet810@gmail.com> - 2015-04-19 16:28 +0000
                Re: primitive instruction for programming Richard Damon <Richard@Damon-Family.org> - 2015-04-19 17:16 -0400
                Re: primitive instruction for programming Tim Rentsch <txr@alumni.caltech.edu> - 2015-04-22 15:28 -0700
          Re: primitive instruction for programming John Bode <jfbode1029@gmail.com> - 2015-04-23 07:20 -0700
  Re: primitive instruction for programming fmassei@gmail.com - 2015-04-13 03:07 -0700
    Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 09:47 -0700
      Re: primitive instruction for programming fmassei@gmail.com - 2015-04-13 11:09 -0700
        Re: primitive instruction for programming Noob <root@127.0.0.1> - 2015-04-13 20:43 +0200
          Re: primitive instruction for programming fmassei@gmail.com - 2015-04-13 12:09 -0700
            Re: primitive instruction for programming Xcott Craver <xcottcraver@gmail.com> - 2015-04-14 07:11 -0700
              Re: primitive instruction for programming fmassei@gmail.com - 2015-04-14 07:28 -0700
                Re: primitive instruction for programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-14 15:57 +0100
                Re: primitive instruction for programming fmassei@gmail.com - 2015-04-14 08:13 -0700
      Re: primitive instruction for programming fir <profesor.fir@gmail.com> - 2015-04-13 14:02 -0700
        Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 14:28 -0700
          Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 22:51 +0100
            Re: primitive instruction for programming fmassei@gmail.com - 2015-04-13 14:58 -0700
              Re: primitive instruction for programming Bartc <bc@freeuk.com> - 2015-04-13 23:25 +0100
                Re: primitive instruction for programming fmassei@gmail.com - 2015-04-13 15:37 -0700
                Re: primitive instruction for programming James Kuyper <jameskuyper@verizon.net> - 2015-04-13 19:09 -0400
                Re: primitive instruction for programming fmassei@gmail.com - 2015-04-13 16:20 -0700
                Re: primitive instruction for programming Robert Wessel <robertwessel2@yahoo.com> - 2015-04-13 18:03 -0500
            Re: primitive instruction for programming asetofsymbols@gmail.com - 2015-04-13 20:58 -0700
          Re: primitive instruction for programming fir <profesor.fir@gmail.com> - 2015-04-13 15:02 -0700

csiph-web