From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5d80f40bdd51947e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-11-03 07:53:05 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!howland.erols.net!dc1.nntp.concentric.net!sjc1.nntp.concentric.net!newsfeed.concentric.net!newsfeed1.thebiz.net!not-for-mail Message-ID: <3A02DF9B.2269@global2000.net> From: "Arthur G. Duncan" Reply-To: aduncan@global2000.net X-Mailer: Mozilla 3.0 (Win95; I) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: binary tree and files References: <8tuk7l$aq5$1@wanadoo.fr> <8tul32$c3p$1@wanadoo.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 8dp0sKqbZOcZW9YufTpFkFFnQnhfFzZtCxVpnQ2S921h2TDlaJJ/fFM8t5Xk X-Trace: WXELRyM4dDAMZI0UEaTN+LDmZs1g1hTW3OF4SFJeui9cj+1pmG8gmmZD6GKtLtqS24vJDLNzrRxv!Vc+DW2M0A71uH3pN2psBMwvFEEsUGn5+8riGDPqpito4vK3TjUDE5Vh2Vg4QM0QJPN6wyrYl1H7U!C8P+qgB0bPEAjtieyg== X-Complaints-To: news-abuse@thebiz.net X-Abuse-Info: Please be sure to forward a copy of ALL headers to X-Abuse-Info: news-abuse@thebiz.net, otherwise we will be unable X-Abuse-Info: to process your complaint properly. NNTP-Posting-Date: Fri, 03 Nov 2000 10:52:52 EST Organization: BiznessOnline.com, Inc. Date: Fri, 03 Nov 2000 15:53:02 GMT Xref: supernews.google.com comp.lang.ada:1750 Date: 2000-11-03T15:53:02+00:00 List-Id: 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