The unordered_map::bucket() is a built-in STL function in C++ which returns the bucket number where the element with the key k is located in the map.
Parameter: The function accepts one mandatory parameter key which specifies the key whose bucket number is to be returned.
Return Value: This method returns an unsigned integral type which represents the bucket number of the key k which is passed in the parameter.
Below program illustrate the unordered_map::bucket() function:
The bucket number of key France is 3
- unordered_set bucket() function in C++ STL
- unordered_multiset bucket() function in C++ STL
- unordered_multimap bucket() function in C++ STL
- Difference between Virtual function and Pure virtual function in C++
- cin get() in C++ with Examples
- Difference between Increment and Decrement Operators
- Map of Vectors in C++ STL with Examples
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
- C++ program to print all Even and Odd numbers from 1 to N
- Reverse the content of a file and store it in another
- Minimum cells to be flipped to get a 2*2 submatrix with equal elements
- Nested Loops in C++ with Examples
- _Find_first() function in C++ bitset with Examples
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.