bluntm Posted June 11, 2009 Share Posted June 11, 2009 hi iv been having some trouble mapping out a tree structure in C# I have a tree structure that i was to map, each node could have any number of children and these children could have any number of children and so on. I'm looking to build a list of strings that contain every possible path from the root node to the last child. so far iv only been able to run down one path of the tree but i have been running into issues trying to get every path any help is greatly appreciated Quote Link to comment Share on other sites More sharing options...
Jason Cooper Posted June 11, 2009 Share Posted June 11, 2009 How deep is your tree? The easy way to deal with trees is usually a recursive function, but you can hit stack problems with a deep tree. Quote Link to comment Share on other sites More sharing options...
bluntm Posted June 11, 2009 Author Share Posted June 11, 2009 the main problem is that i don't know how deep the is and it sould expand at any time, so will have to be flexible. Quote Link to comment Share on other sites More sharing options...
Emeryth Posted June 12, 2009 Share Posted June 12, 2009 http://en.wikipedia.org/wiki/Tree_traversal This should help. Quote Link to comment Share on other sites More sharing options...
bluntm Posted June 15, 2009 Author Share Posted June 15, 2009 thanks some useful information on that page Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.