Because of the way that the garbage collector works, hash tables are usually a better choice than actual tree structures. Most tree data structure needs are satisfied by Dictionary and friends, which actually use hash tables internally.
However, if you want a true tree structure, get PowerCollections. They have an actual tree structure (red/black, if memory serves correctly), with some other data structures built on that tree.
IHierarchyData/IHierarchialEnumarable are not supported by PowerCollections.
Programming blog: http://nitoprograms.blogspot.com/
I will be in Chicago for the WPF training: http://blogs.msdn.com/jaimer/archive/2009/04/01/announcing-the-using-wpf-to-build-lob-applications-training-tour.aspx
When you're mentioning IHierarchicalEnumerable interface, I suppose that you need to generic tree traversal algorithms which uses iterator design pattern as IEnumerable, then you could try looking at the code I've written a while back ago which supports linearizing nested data structure to support LINQism against nested data structure:
I don't implement the in-order traversal, since it doesn't make sense for generic n-ary tree structure.
Another Paradigm Shift
- Edited by Marco Zhou Wednesday, May 13, 2009 4:49 AM bad typo