linked representation...................for k-ary trees use sibling and lchild pntr...........arrays can lead to memory wastage .Moreover arrays have to be statically allocated
On Mon, Nov 15, 2010 at 2:32 AM, Ruturaj <[email protected]> wrote: > Since its a data structure, we need to root the tree. Plus my > suggestion will only work for directed trees. all children point to > their parents. > > for a node i, if its parent is j a[i]=j > a[root] = -1 > > this can store a tree pretty fast. > > > else normally we can use a linked list etc. > > On Nov 14, 11:53 pm, bittu <[email protected]> wrote: > > which data structure is best & used to implmets the tree > > > > Regards > > Shashank > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
