Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

rmtree.C

Go to the documentation of this file.
00001 /*
00002  *  rmtree.C: recursively deletes a node together with all of its offspring
00003  *.............................................................................
00004  *    version 1:  Nov 1994   Piet Hut
00005  *.............................................................................
00006  */
00007 #include "node.h"
00008 
00009 void rmtree(node* b,
00010             bool delete_b)      // default = true
00011 {
00012     node* d = b->get_oldest_daughter();
00013     while (d) {
00014         node* tmp = d->get_younger_sister();
00015         rmtree(d);
00016         d = tmp;
00017     }
00018 
00019     if (delete_b) delete b;     // optionally leave node itself untouched
00020 }
00021 
00022 /* endof: rmtree.c */

Generated at Sun Feb 24 09:57:13 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001