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
- 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
- _Find_next() function in C++ bitset with Examples
- Left-Right traversal of all the levels of N-ary tree
- Difference between Iterators and Pointers in C/C++ with Examples
- ostream::seekp(pos) method in C++ with Exmaples
- Default Methods in C++ with Examples
- C++ Tutorial
- Hello World Program : First program while learning Programming
- Difference between Argument and Parameter in C/C++ 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.