.NET Embedded AVL Tree?

Is there a built-in AVL tree in .NET libraries?

I searched but not found.

  • If so, where? what namespace?
  • If not, is there a good implementation for AVL Trees in C #?
  • If not! is there an easy way to do this? I know how this works, and already built it in my native C ++, but now I don’t have the time and I'm afraid of poor performance if I did it myself.
+6
source share
3 answers

You can use System.Collections.Generic.SortedSet<T> . I think this is implemented using a red-black tree, which is very similar to the AVL tree.

+8
source

A quick search found an implementation here . The code looks clean, but I have not tried it.

If nothing else, you can run a quick performance test with SortedSet<T> (as suggested by @Josef) to find out if there is a difference in your use case.

+3
source

a C # implementation can be found @ http://code.google.com/p/self-balancing-avl-tree/ . concat and split operations are performed.

0
source

Source: https://habr.com/ru/post/905388/


All Articles