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 <shashank7andr...@gmail.com> 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 algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.