Re: Inserting nodes into a tree

2011-02-11 Thread spir
On 02/11/2011 09:21 PM, Steven Schveighoffer wrote: On Fri, 11 Feb 2011 14:49:41 -0500, Andrej Mitrovic wrote: On 2/11/11, Steven Schveighoffer wrote: struct Node { int id; string myName; Node *parent; // only needed if you want to go up the tree. Node *[] children; } -Steve What are the

Re: Inserting nodes into a tree

2011-02-11 Thread Andrej Mitrovic
Cool, thanks for the insight. :)

Re: Inserting nodes into a tree

2011-02-11 Thread Steven Schveighoffer
On Fri, 11 Feb 2011 14:49:41 -0500, Andrej Mitrovic wrote: On 2/11/11, Steven Schveighoffer wrote: struct Node { int id; string myName; Node *parent; // only needed if you want to go up the tree. Node *[] children; } -Steve What are the benefits of using struct pointers

Re: Inserting nodes into a tree

2011-02-11 Thread Andrej Mitrovic
On 2/11/11, Steven Schveighoffer wrote: > struct Node > { > int id; > string myName; > Node *parent; // only needed if you want to go up the tree. > Node *[] children; > } > > -Steve > What are the benefits of using struct pointers instead of classes in this case?

Re: Inserting nodes into a tree

2011-02-11 Thread Steven Schveighoffer
On Fri, 11 Feb 2011 14:28:47 -0500, %u wrote: Please pardon my complete lack of knowledge. Please provide some suggestions/pointers so that I can improve myself. Given a table containing three values (ie, myName, myId, parentId), how does one insert those values into a tree such that the paren

Inserting nodes into a tree

2011-02-11 Thread %u
Please pardon my complete lack of knowledge. Please provide some suggestions/pointers so that I can improve myself. Given a table containing three values (ie, myName, myId, parentId), how does one insert those values into a tree such that the parent/child relationship defined in the table is maint