What's a good and stable C++ tree implementation?

后端 未结 6 1524
孤独总比滥情好
孤独总比滥情好 2020-12-04 15:29

I\'m wondering if anyone can recommend a good C++ tree implementation, hopefully one that is stl compatible if at all possible.

For the record, I\'ve written tree a

6条回答
  •  失恋的感觉
    2020-12-04 15:59

    I am going to suggest using std::map instead of a tree.

    The complexity characteristics of a tree are:

    Insert:       O(ln(n))
    Removal:  O(ln(n))
    Find:         O(ln(n))

    These are the same characteristics the std::map guarantees.
    Thus as a result most implementations of std::map use a tree (Red-Black Tree) underneath the covers (though technically this is not required).

提交回复
热议问题