Search code examples
algorithmprogramming-languageshashtable

In what languages, associative arrays are implemented using redblack tree instead of hashtable?


In wikipedia: http://en.wikipedia.org/wiki/Red-black_tree#Applications_and_related_data_structures

red-black tree is a type of self-balancing binary search tree, a data structure used in computing science, typically used to implement associative arrays.

Anyone know a language implemented associative array using redblack tree?


Solution

  • C++ std::map is often implemented as red-black tree. It's the basic associative array. The other one (new) is std::unordered_map and is in fact a hash-map.