Special Search Functions
The functions listed in this lesson make searching more efficient.
Ordered associative containers are optimized for searching, and so they offer unique search functions.
Seach function | Description |
---|---|
ordAssCont.count(key) |
Returns the number of values with the key . |
ordAssCont.find(key) |
Returns the iterator of key in ordAssCont . If there is no key in ordAssCont it returns ordAssCont.end() . |
ordAssCont.lower_bound(key) |
Returns the iterator to the first key in ordAssCont in which key would be inserted. |
ordAssCont.upper_bound(key) |
Returns the last position of key in ordAssCont in which key would be inserted. |
ordAssCont.equal_range(key) |
Returns the range ordAssCont.lower bound(key) and ordAssCont.upper_bound(key) in a std::pair . |
Special search functions of the ordered associative containers
Now, the application of the special search functions.
Get hands-on with 1400+ tech skills courses.