Subj : Re: How to deal with Tree with several branchs? To : comp.programming From : Jon Harrop Date : Wed Jul 27 2005 01:52 am Davy wrote: > My program deal with a several level tree with several branchs. The > amount of branchs from father node is not known. So I want to creat a > tree with dynamic branchs. Rather than: type 'a tree = Empty | Node of 'a tree * 'a * 'a tree use: type 'a tree = Empty | Node of 'a tree list > Now I use the structure: > typedef struct gnodes > { > int level; //tree level > struct gnodes* pfather; > struct gnodes* pbrother; > struct gnodes* pchild; > struct gnodes* puncle; > } gnode; That isn't a tree, it is a graph. At the _very_ least use C++ and not C... -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .