unordered_set rehash() function in C++ STL
The unordered_set::rehash() is a built-in function in C++ STL which is used to set the number of buckets in the container of unordered_set to given size or more. If size is greater than the current size of the container, then rehash is called. If it is lower than the current size, then the function has no effect on bucket count of hash.
Parameter: The function accepts a mandatory parameter n which specifies the minimum number of buckets for the container.
Return Value: This function doesn’t returns anything.
Below programs illustrate the unordered_set::rehash() function:
users for geeks The bucket count is 11
DS in experts are users for geeks The bucket count is 23