tags:

views:

120

answers:

3

I'm looking for a well tested simple in-memory binary tree implementation for c#. I would appreciate any pointers...

+1  A: 

How about this article on MSDN? (An Extensive Examination of Data Structures Using C# 2.0 ).

Oded
A: 

You could try this implementation found at CodeProject. Has worked for me.

Mikael Svenson
+3  A: 

The .NET framework already contains them, they are just not advertised as such. Probably because of the inherent ambiguity in the three different ways to iterate a tree. SortedDictionary uses a self-balancing red-black tree under the hood and has the same time and space complexity as a binary tree. You'll need SortedList if your tree contains duplicates.

Hans Passant
Excellent just what I was after!
Lee Alexander