unordered_set::max_load_factor() is a function in C++ STL which returns(Or sets) the current maximum load factor of the unordered set container.
The load factor is the ratio between number of elements in the container and number of buckets(bucket_count). By default the maximum load factor of an unordered set container is set to 1.0 .
Return Value This method returns the current maximum load factor.
Below program illustrate the unordered_set::max_load_factor() method:
Maximum load factor of uset: 1 Current load factor of uset: 0.8
Parameter: This method takes a floating point number as parameter to which the max_load_factor is to be set.
Return Value: This method does not return any value .
Below program illustrate the unordered_set::max_load_factor(float) method:
New Maximum load factor of uset: 0.5 Current load factor of uset1: 0.363636
- AngularJS | ng-include Directive
- How to select an element by name with jQuery?
- Sort an array according to absolute difference with given value using Functors
- acpid command in Linux with Examples
- Perl | Reading a CSV File
- How to remove items from a select box ?
- dump command in Linux with examples
- aplaymidi Command in Linux with Examples
- domainname Command in Linux With Examples
- AngularJS | Controllers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.