Documentation for c26eea874d

This commit is contained in:
realstealthninja
2025-05-19 11:38:33 +00:00
parent c7a9a42397
commit 14583a2f33
2829 changed files with 30266 additions and 21669 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: strings/brute_force_string_searching.cpp Source File</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
@@ -60,7 +60,7 @@ window.MathJax = {
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,7 +124,7 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
<div class="headertitle"><div class="title">brute_force_string_searching.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d3/d7d/brute__force__string__searching_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<a href="../../d3/d7d/brute__force__string__searching_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#ifdef _MSC_VER</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;string&gt;</span> <span class="comment">// use this for MS Visual C++</span></div>
@@ -156,18 +156,18 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">using </span><a class="code hl_function" href="../../d9/d03/namespacestring__search.html#aeb2cd81064717aedd62bfb096b1a73d8">string_search::brute_force</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div>
<div class="foldopen" id="foldopen00041" data-start="{" data-end="};">
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123"> 41</a></span><span class="keyword">const</span> std::vector&lt;std::vector&lt;std::string&gt;&gt; <a class="code hl_variable" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123">test_set</a> = {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// {text, pattern, expected output}</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> {<span class="stringliteral">&quot;a&quot;</span>, <span class="stringliteral">&quot;aa&quot;</span>, <span class="stringliteral">&quot;-1&quot;</span>}, {<span class="stringliteral">&quot;a&quot;</span>, <span class="stringliteral">&quot;a&quot;</span>, <span class="stringliteral">&quot;0&quot;</span>}, {<span class="stringliteral">&quot;ba&quot;</span>, <span class="stringliteral">&quot;b&quot;</span>, <span class="stringliteral">&quot;0&quot;</span>},</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> {<span class="stringliteral">&quot;bba&quot;</span>, <span class="stringliteral">&quot;bb&quot;</span>, <span class="stringliteral">&quot;0&quot;</span>}, {<span class="stringliteral">&quot;bbca&quot;</span>, <span class="stringliteral">&quot;c&quot;</span>, <span class="stringliteral">&quot;2&quot;</span>}, {<span class="stringliteral">&quot;ab&quot;</span>, <span class="stringliteral">&quot;b&quot;</span>, <span class="stringliteral">&quot;1&quot;</span>}};</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 47</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;i : <a class="code hl_variable" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123">test_set</a>) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> output = brute_force(i[0], i[1]);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> output = <a class="code hl_function" href="../../d3/d7d/brute__force__string__searching_8cpp.html#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a>(i[0], i[1]);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (std::to_string(output) == i[2]) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> std::cout &lt;&lt; <span class="stringliteral">&quot;success\n&quot;</span>;</div>
@@ -180,6 +180,7 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
</div>
<div class="ttc" id="abrute__force__string__searching_8cpp_html_ae2abaa9caa13fff35e45edca00bee123"><div class="ttname"><a href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123">test_set</a></div><div class="ttdeci">const std::vector&lt; std::vector&lt; std::string &gt; &gt; test_set</div><div class="ttdef"><b>Definition</b> <a href="#l00041">brute_force_string_searching.cpp:41</a></div></div>
<div class="ttc" id="abrute__force__string__searching_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00047">brute_force_string_searching.cpp:47</a></div></div>
<div class="ttc" id="abrute__force__string__searching_8cpp_html_aeb2cd81064717aedd62bfb096b1a73d8"><div class="ttname"><a href="../../d3/d7d/brute__force__string__searching_8cpp.html#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a></div><div class="ttdeci">int brute_force(const std::string &amp;text, const std::string &amp;pattern)</div><div class="ttdef"><b>Definition</b> <a href="#l00021">brute_force_string_searching.cpp:21</a></div></div>
<div class="ttc" id="anamespacestring__search_html"><div class="ttname"><a href="../../d9/d03/namespacestring__search.html">string_search</a></div><div class="ttdoc">String search algorithms.</div><div class="ttdef"><b>Definition</b> <a href="#l00013">brute_force_string_searching.cpp:13</a></div></div>
<div class="ttc" id="anamespacestring__search_html_aeb2cd81064717aedd62bfb096b1a73d8"><div class="ttname"><a href="../../d9/d03/namespacestring__search.html#aeb2cd81064717aedd62bfb096b1a73d8">string_search::brute_force</a></div><div class="ttdeci">int brute_force(const std::string &amp;text, const std::string &amp;pattern)</div><div class="ttdef"><b>Definition</b> <a href="#l00021">brute_force_string_searching.cpp:21</a></div></div>
</div><!-- fragment --></div><!-- contents -->
@@ -188,7 +189,7 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp.html">brute_force_string_searching.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>