From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 20 Apr 93 04:45:55 GMT From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!uw m.edu!ogicse!psgrain!charnel!rat!zeus!cymbal.calpoly.edu!jplee@ucbvax.Berkeley. EDU (JASON LEE) Subject: Deallocating linked lists of linked lists Message-ID: <1993Apr20.044555.154198@zeus.calpoly.edu> List-Id: Here's a good question... I wrote a program that simulates a graph, and thus I need to have a linked list, one of whose components is a linked list, showing on which vertices that particular vertex is incident upon. Well, enough of the nitty gritty. Here is the question. If I have a variable that is a record, and one of the fields of the record is the head pointer to another linked list, will it be sufficient to just deallocate the one variable, or do I have to go inside and deallocate everthing? Here are my type declarations: type pointer is access edge; type edge is record incident_on : pointer; id_number : positive; end record; type incidence_node; type edge_list is access incidence_node; type incidence_node is record item : edge; next : edge_list; end record; type vertex is record data : node_item_type; id_number : positive; incidence : incidence_list; end record; type graph is access vertex; So how would I dynamically deallocate something of type graph? Thanks for any help. -- Jason Lee jplee@oboe.calpoly.edu jlee@cash.busfac.calpoly.edu Giants e ^ i*pi + 1 = 0 The most beautiful equation in mathematics. Magic For all sad words of tongue and pen, the saddest are these: Number: "It might have been." John Greenleaf Whittier 150