Is there a binary tree in .NET?

4

I do not know if it's hidden somewhere and I did not see a binary tree structure in .NET.

I searched the documentation for all Collection , including sub-levels and nothing. Are not you? Why not have something so important?

    
asked by anonymous 03.04.2017 / 14:19

1 answer

6

Binary tree often has problems with reference location, so avoid using. The .NET Framework tries to provide the most useful frameworks only and let each one provide the rest, especially if you consider that there are several ways to implement a binary tree, .NET could not deliver all of the required ones.

Actually there is even binary tree in .NET, but this is considered an implementation detail of structures that guarantee a certain commitment, but not that it will be a binary tree. It is better to give solutions than specific structures. See SortedDictionary . There is also SortedList .

There are a few ready-made implementations, perhaps the best known of which are PowerCollections (I hope they migrate to GitHub) and C5 . Maybe find some that is useful for your need there. Otherwise you have to look for others or make your own implementation.

    
03.04.2017 / 14:29