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
- set find() function in C++ STL
- Find if there is a subarray with 0 sum
- string find in C++
- multimap find() in C++ STL
- 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)
- Find All Duplicate Subtrees
- How to find the sum of elements of a Vector using STL in C++?
- How to find the sum of elements of an Array using STL in C++?
- Find largest d in array such that a + b + c = d
- Find elements of an Array which are Odd and Even using STL in C++
- Find top three repeated in array
- unordered_multiset 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.