Tech Off Post

Single Post Permalink

View Thread: AVL tree vs red-black tree
  • User profile image

    Mr Crash said:
    rhm said:

    Based on what i've read and seen ,suggest/say we still need these kinds of algorithms for performance ( example, file systems )


    .NET (one of my favorite things to pick on) if you've chosen .net to begin with you're not concerned with performance (primarily) to begin with.

    That said, if there isn't any tree algorithms in .net then it would just be an oversight, i'm guessing, or perhaps feature prioritization.


    It's rare these days for someone to deal with these data structures directly. For example .NET's SortedDictionary and SortedSet use a red black tree under the covers. These 2 offer the performance characteristics of rb trees and an easy to use add/search/remove interface. There's little reason for rb tree (or any other kind of binary tree) to be exposed directly by .NET's  base class library.


    And yes, filesystems use trees for file lookup but they usually use B-trees, not RB/AVL trees. B-trees are better suited to the block based access that hard disks offer.