Tree Data Structure Source Code Posted
Posted by Dan Vanderboom on April 3, 2008
For those of you who have been waiting for the source code to the Tree<T> article I wrote, I’m happy to announce that it’s finally available. I had originally intended to supply some non-trivial examples of its use, but with my super busy schedule at work and otherwise, I’ve had to reduce the scope just to get it out there. One of my examples is large enough to warrant one or more large articles, so I also didn’t want to just toss them in there without sufficient explanation as to how it all works.
While I work on getting those ready, check out Damon Payne’s article on using a non-binary tree for modeling dependencies among concurrently-running tasks with the Task Parallel Library. This is a great use of the tree data structure. It would be interesting to see how that would work for tasks with cross-branch dependencies. Does the tree become a graph? Would iteration become a garbage-collection-like traversal? How would it need to respond to insertion of tasks or modification or dependencies during execution?
My non-binary tree article, which has been updated with a short section just before the conclusion, can be found here. At the very top of the article is a link to the source code in the form of a Visual Studio 2008 solution. For those of you with VS2005, you should be able to easily extract the code and create a VS2005 project out of it. I specifically targeted .NET 2.0 instead of 3.5, and originally tested it against Compact Framework.
I’ll also be doing further development of this library, so if you have any cool feature requests, let me know.