![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
String pattern search - brute force. More...
#include <iostream>
#include <cstring>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | string_search |
String search algorithms. | |
Functions | |
int | string_search::brute_force (const std::string &text, const std::string &pattern) |
int | main () |
int | brute_force (const std::string &text, const std::string &pattern) |
Variables | |
const std::vector< std::vector< std::string > > | test_set |
String pattern search - brute force.
Definition in file brute_force_string_searching.cpp.
int string_search::brute_force | ( | const std::string & | text, |
const std::string & | pattern ) |
Find a pattern in a string by comparing the pattern to every substring.
text | Any string that might contain the pattern. |
pattern | String that we are searching for. |
Definition at line 21 of file brute_force_string_searching.cpp.
int main | ( | void | ) |
Main function
Definition at line 47 of file brute_force_string_searching.cpp.
const std::vector<std::vector<std::string> > test_set |
set of test cases
Definition at line 41 of file brute_force_string_searching.cpp.