comp.lang.ada
 help / color / mirror / Atom feed
From: "Arthur G. Duncan" <aduncan@global2000.net>
Subject: Re: binary tree and files
Date: Fri, 03 Nov 2000 15:53:02 GMT
Date: 2000-11-03T15:53:02+00:00	[thread overview]
Message-ID: <3A02DF9B.2269@global2000.net> (raw)
In-Reply-To: 8tul32$c3p$1@wanadoo.fr

Franck wrote:

  ... question on how to save and restore a binary tree of the 
      form: 

> type T_node;
> type Pt_tree is access T_Node;
> 
> type T_Node is record
>    name : T_name;
>    G, D : Pt_tree;
> end record;
> 

If it is, indeed, a tree (no cycles), you can simply write it out
as a set of nested tuples (LISP list notation is as good a form
as any).

If there are cycles (or the tree is reentrant and you want to save
disk space) you can label the nodes and write out label references
wherever you have a pointer in the original data structure. 

Hope this helps,

- Art Duncan
  aduncan@global2000.net



  reply	other threads:[~2000-11-03 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-03 15:06 binary tree and files Franck
2000-11-03 15:20 ` Franck
2000-11-03 15:53   ` Arthur G. Duncan [this message]
2000-11-03 16:47     ` Franck
2000-11-03  0:00       ` tmoran
2000-11-03  0:00       ` John Cupak
2000-11-03  0:00         ` Franck
2000-11-03  0:00           ` Pascal Obry
2000-11-03  0:00             ` Franck
2000-11-03  0:00               ` Larry Hazel
2000-11-04  0:00   ` David C. Hoos, Sr.
2000-11-04  0:00 ` David C. Hoos, Sr.
2000-11-05  1:01   ` Jeff Carter
2000-11-05  0:00     ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox