我正在寻找一个行之有效的简单的内存二叉树实现C#。我想AP preciate任何指针...
I'm looking for a well tested simple in-memory binary tree implementation for c#. I would appreciate any pointers...
在.NET框架已经包含了他们,他们只是不公布这样。可能是因为在三种不同的方式来遍历树固有的模糊性。 SortedDictionary使用自平衡红黑树罩下,并且具有相同的时间和空间复杂度的二进制树。你需要排序列表,如果你的树包含重复。
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.