Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Std/Stl/CollectionClasses/SortedCollections

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Some STL collection classes are "sorted", in the sense that the class' items are internally stored using a tree data structure. Each item contains a "key", and the tree data structure maintains a property whereby the items are sorted by that key. As a result, client code can still iterate over the data structure from a "beginning" (item having the smallest key) to an "ending" (item having the largest key), even though that data isn't being linearly-stored. To define the sorting of keys, a sorted collection object is associated with a "sort-class" object. A Pair as one Item Tuple Map Multimap Set Multiset Hash-Table