AlgoMaster Logo

std::unordered_set & std::unordered_multiset

Last Updated: May 22, 2026

High Priority
9 min read

std::unordered_set<T> is a hash-table-backed associative container that stores unique elements with no defined order, added in C++11. It trades the sorted-order guarantee of std::set for average constant-time insert, find, and erase. std::unordered_multiset is its sibling that allows duplicates. This chapter covers the bucket-based internals, the API, custom hashing and equality, the rehash mechanism, and when to pick unordered_set over the tree-based set.

Premium Content

Subscribe to unlock full access to this content and more premium articles.