find function in C++ is used to search for a specific key in an unordered map.
Parameters: It takes the key as a parameter.
Return values: If the given key exists in unordered_map it returns an iterator to that element otherwise it returns the end of the map iterator.
Below program illustrate the working of find function:
Element Not Present Element Present
Time Complexity : O(1) on average.
- std::find in C++
- map find() function in C++ STL
- string find in C++
- set find() function in C++ STL
- Find if there is a subarray with 0 sum
- multimap find() in C++ STL
- Find top three repeated in array
- Find Nth term of the series 0, 2, 4, 8, 12, 18...
- Find Nth term of series 1, 4, 15, 72, 420...
- Find All Duplicate Subtrees
- Find the overlapping sum of two arrays
- Program to find the sum of the series (1/a + 2/a^2 + 3/a^3 + ... + n/a^n)
- unordered_set find() function in C++ STL
- unordered_multiset find() function in C++STL
- unordered_multimap find() function in C++ STL
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.