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
- What is Hactoberfest and How One Can Take Participate in it?
- CSS | Combine background image with gradient overlay
- How to Design Half-Page Carousel in Bootstrap ?
- What is the meaning of let-* in Angular 2 Templates ?
- Difference between multiple arguments and options object
- How to Check Twitter Bootstrap is Loaded or not ?
- How to iterate through all selected elements into an array ?
- How to put images in a box without space using Bootstrap?
- Node.js | Buffer.alloc() Method
- How to insert HTML into view from AngularJS controller?
- Node.js | fs.truncate() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.