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


Groups > comp.lang.c > #11003

Re: Manage an unknown number of objects without malloc

From Uno <merrilljensen@q.com>
Newsgroups comp.lang.c
Subject Re: Manage an unknown number of objects without malloc
Date 2011-09-27 04:17 -0700
Message-ID <9edm56F8uuU1@mid.individual.net> (permalink)
References (2 earlier) <0578e15c-8633-482f-832e-7d1b82e61abd@u6g2000vbo.googlegroups.com> <9e8feaFu6kU1@mid.individual.net> <876d0324-0d80-4b5e-a030-5b96d7060ff6@u13g2000vbx.googlegroups.com> <9ed0dsFuijU1@mid.individual.net> <52bbc3f6-8c7e-44d7-b8f0-989f1b81b522@x19g2000vbl.googlegroups.com>

Show all headers | View raw


On 9/27/2011 1:09 AM, Malcolm McLean wrote:

> struct edge
> {
>    struct node *node1;
>    struct node *node2;
>    int direction; /* 0 = undirected, 1 = node1 ->  node2, 2 = node2 ->
> node 1, 3 = bidirectional */
>    double weight;
>    void *data;
> };


If mein Gedankenexperiment is to be realized in C, I think we need a 
different node.  Imagine a universe populated by only space and steel.

I'll admit that in the realm of universes, this one counts as pretty 
parochial, because the whole darn thing is plum, level, square, where 
every node has order 6.
>
> struct node
> {
>    struct edge **incoming;
>    int Nin;
>    struct edge **outgoing;
>    int Nout;
>    void *data;
> };
>
> struct graph
> {
>    struct edge *edges;
>    int Nedges;
>    struct node *node;
>    int Nnodes;
>    struct node *root; /* can be null */
> };

As far as heat transfer goes, it won't get worse than -k^2dx locally. 
The magic question is how small this universe must be in order to 
collapse locally to an energy source.

Anti-regime protests everywhere in Amiland,
-- 
Uno

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


Thread

Re: Manage an unknown number of objects without malloc Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-25 01:09 -0700
  Re: Manage an unknown number of objects without malloc Uno <merrilljensen@q.com> - 2011-09-25 04:52 -0700
    Re: Manage an unknown number of objects without malloc Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-25 04:57 -0700
      Re: Manage an unknown number of objects without malloc Uno <merrilljensen@q.com> - 2011-09-26 22:06 -0700
        Re: Manage an unknown number of objects without malloc Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-27 01:09 -0700
          Re: Manage an unknown number of objects without malloc Uno <merrilljensen@q.com> - 2011-09-27 04:17 -0700
          Re: Manage an unknown number of objects without malloc Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-27 11:54 +0100
            Re: Manage an unknown number of objects without malloc Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-09-27 04:43 -0700

csiph-web