Maps
Collections of key-value pairs such that each unique key can have only one occurrence in the collection.
Import alias 'ads-js/maps'
This group provides implementations of different data-structures for fast search and access. It does not include common for such libraries HashMap/HashSet classes because they do already exist in JavaScript since ES6. Instead of replacing standard JS built-ins, classes presented here implement the same interfaces and may be used alongside with the first ones in the same client code.
Table of contents
SortedMap - a map that provides ordering on its keys. Keys are ordered by a comparator provided at map creation time or by default as strings.
MaximaSet - container which stores only pairs forming strictly increasing trend in both keys and values. This structure is based on SortedMap.
AVLTreeMap - sorted map based on an AVL binary tree structure.
SplayTreeMap - sorted map based on a splay binary tree structure.
RedBlackTreeMap - sorted map based on a red-black binary tree structure.
Last updated
Was this helpful?