Search Algorithms

An introduction to the 8 main searching algorithms in the C++ standard library, including find(), find_if(), find_if_not(), find_first_of(), adjacent_find(), search_n(), search(), and find_end().

Ryan McCombe
Updated
Hello! I'm here to help you with any questions about this lesson. Feel free to ask me anything - whether it's about specific concepts, examples, or how to apply what you've learned!

Questions & Answers

Answers are generated by AI models and may not have been reviewed. Be mindful when running any code on your device.

Using std::ranges::find() with Custom Data Types
How can I use std::ranges::find() with custom data types that don't implement the equality operator ==?
Case-Insensitive Search Using std::ranges::find_if()
How can I make std::ranges::find_if() case-insensitive when searching through a container of strings?
Finding the Last Occurrence of an Element in a Container
How do I search for the last occurrence of an element using std::ranges::find() or std::find()?
Searching for Multiple Occurrences of a Value in a Container
What is the best way to search for multiple occurrences of a value in a container using standard library algorithms?
Searching for a Substring Appearing Multiple Times
How do I handle searching for a substring within a string when the substring can appear multiple times?
Boyer-Moore vs Boyer-Moore-Horspool Search Algorithms
What are the differences and benefits of using std::boyer_moore_searcher versus std::boyer_moore_horspool_searcher in practical scenarios?