mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-12 03:28:29 +08:00
Documentation for 8b1eab204b
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: search/exponential_search.cpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: search/exponential_search.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -121,7 +138,9 @@ Include dependency graph for exponential_search.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d3c/exponential__search_8cpp__incl.svg" width="326" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
</div>
|
||||
<p><a href="../../d8/d8a/exponential__search_8cpp_source.html">Go to the source code of this file.</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:ab06cedad209456eae95d37b7cd66acae" id="r_ab06cedad209456eae95d37b7cd66acae"><td class="memTemplParams" colspan="2">template<class Type > </td></tr>
|
||||
@@ -137,6 +156,8 @@ Functions</h2></td></tr>
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Exponential_search" target="_blank">Exponential search algorithm</a> </p>
|
||||
<dl class="section copyright"><dt>Copyright</dt><dd>2020 Divide-et-impera-11</dd></dl>
|
||||
<p>The algorithm try to search the range where the key should be. If it has been found we do a binary search there. The range of the search grows by exponential every time. If the key is larger than the last element of array, the start of block(block_front) will be equal to the end of block(block_size) and the algorithm return null ponter, every other cases the algoritm return fom the loop. </p>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html">exponential_search.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ab06cedad209456eae95d37b7cd66acae" name="ab06cedad209456eae95d37b7cd66acae"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ab06cedad209456eae95d37b7cd66acae">◆ </a></span>binary_s()</h2>
|
||||
@@ -182,11 +203,13 @@ template<class Type > </div>
|
||||
<code>nullptr</code> if value not found </dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html#l00034">34</a> of file <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html">exponential_search.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 34</span> {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> int32_t lower_index(0), upper_index(size - 1), middle_index;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">while</span> (lower_index <= upper_index) {</div>
|
||||
<div class="line"><span class="lineno"> 38</span> middle_index = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/floor.html">std::floor</a>((lower_index + upper_index) / 2);</div>
|
||||
<div class="line"><span class="lineno"> 38</span> middle_index = std::floor((lower_index + upper_index) / 2);</div>
|
||||
<div class="line"><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (*(array + middle_index) < key)</div>
|
||||
<div class="line"><span class="lineno"> 41</span> lower_index = (middle_index + 1);</div>
|
||||
@@ -198,13 +221,7 @@ template<class Type > </div>
|
||||
<div class="line"><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 49</span>}</div>
|
||||
<div class="ttc" id="afloor_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/floor.html">std::floor</a></div><div class="ttdeci">T floor(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d8/d8a/exponential__search_8cpp_ab06cedad209456eae95d37b7cd66acae_cgraph.svg" width="202" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
@@ -222,6 +239,8 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Main function </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html#l00074">74</a> of file <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html">exponential_search.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 74</span> {</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="comment">// TEST CASES</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="keywordtype">int</span>* sorted_array = <span class="keyword">new</span> <span class="keywordtype">int</span>[7]{7, 10, 15, 23, 70, 105, 203};</div>
|
||||
@@ -233,13 +252,8 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="keyword">delete</span>[] sorted_array;</div>
|
||||
<div class="line"><span class="lineno"> 83</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 84</span>}</div>
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_af421bf4b7b95f20ac86c233adfdb9208"><div class="ttname"><a href="#af421bf4b7b95f20ac86c233adfdb9208">struzik_search</a></div><div class="ttdeci">Type * struzik_search(Type *array, size_t size, Type key)</div><div class="ttdef"><b>Definition</b> exponential_search.cpp:59</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d8/d8a/exponential__search_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="454" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_af421bf4b7b95f20ac86c233adfdb9208"><div class="ttname"><a href="#af421bf4b7b95f20ac86c233adfdb9208">struzik_search</a></div><div class="ttdeci">Type * struzik_search(Type *array, size_t size, Type key)</div><div class="ttdef"><b>Definition</b> <a href="../../d8/d8a/exponential__search_8cpp_source.html#l00059">exponential_search.cpp:59</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="af421bf4b7b95f20ac86c233adfdb9208" name="af421bf4b7b95f20ac86c233adfdb9208"></a>
|
||||
@@ -274,6 +288,8 @@ template<class Type > </div>
|
||||
<li>Space Complexity O(1)</li>
|
||||
<li>Auxiliary Space Complexity O(1) </li>
|
||||
</ul>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html#l00059">59</a> of file <a class="el" href="../../d8/d8a/exponential__search_8cpp_source.html">exponential_search.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 59</span> {</div>
|
||||
<div class="line"><span class="lineno"> 60</span> uint32_t block_front(0), block_size = size == 0 ? 0 : 1;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">while</span> (block_front != block_size) {</div>
|
||||
@@ -287,13 +303,8 @@ template<class Type > </div>
|
||||
<div class="line"><span class="lineno"> 69</span> }</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 71</span>}</div>
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_ab06cedad209456eae95d37b7cd66acae"><div class="ttname"><a href="#ab06cedad209456eae95d37b7cd66acae">binary_s</a></div><div class="ttdeci">Type * binary_s(Type *array, size_t size, Type key)</div><div class="ttdef"><b>Definition</b> exponential_search.cpp:34</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d8/d8a/exponential__search_8cpp_af421bf4b7b95f20ac86c233adfdb9208_cgraph.svg" width="356" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_ab06cedad209456eae95d37b7cd66acae"><div class="ttname"><a href="#ab06cedad209456eae95d37b7cd66acae">binary_s</a></div><div class="ttdeci">Type * binary_s(Type *array, size_t size, Type key)</div><div class="ttdef"><b>Definition</b> <a href="../../d8/d8a/exponential__search_8cpp_source.html#l00034">exponential_search.cpp:34</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<map id="binary_s" name="binary_s">
|
||||
<area shape="rect" id="Node000001" title=" " alt="" coords="5,5,76,31"/>
|
||||
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/floor.html#" title=" " alt="" coords="124,5,196,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="76,16,108,16,108,21,76,21"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
f90bdf5dda11722fafab50c0b5ad183d
|
||||
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: binary_s Pages: 1 -->
|
||||
<svg width="151pt" height="27pt"
|
||||
viewBox="0.00 0.00 151.00 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>binary_s</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="52.75,-19.25 0,-19.25 0,0 52.75,0 52.75,-19.25"/>
|
||||
<text text-anchor="middle" x="26.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">binary_s</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/floor.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="143,-19.25 88.75,-19.25 88.75,0 143,0 143,-19.25"/>
|
||||
<text text-anchor="middle" x="115.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::floor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M53.15,-9.62C60.61,-9.62 68.9,-9.62 76.93,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="76.86,-13.13 86.86,-9.63 76.86,-6.13 76.86,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: binary_s Pages: 1 -->
|
||||
<svg width="151pt" height="27pt"
|
||||
viewBox="0.00 0.00 151.00 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>binary_s</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="52.75,-19.25 0,-19.25 0,0 52.75,0 52.75,-19.25"/>
|
||||
<text text-anchor="middle" x="26.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">binary_s</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/floor.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="143,-19.25 88.75,-19.25 88.75,0 143,0 143,-19.25"/>
|
||||
<text text-anchor="middle" x="115.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::floor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M53.15,-9.62C60.61,-9.62 68.9,-9.62 76.93,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="76.86,-13.13 86.86,-9.63 76.86,-6.13 76.86,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,9 +0,0 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="Node000001" title=" " alt="" coords="5,5,55,31"/>
|
||||
<area shape="rect" id="Node000002" href="$d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208" title=" " alt="" coords="103,5,209,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,16,87,16,87,21,55,21"/>
|
||||
<area shape="rect" id="Node000003" href="$d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae" title=" " alt="" coords="257,5,327,31"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="210,16,241,16,241,21,210,21"/>
|
||||
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/floor.html#" title=" " alt="" coords="375,5,448,31"/>
|
||||
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="328,16,360,16,360,21,328,21"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
8bd0fd7647e850f173ab507a3b0c2fd0
|
||||
@@ -1,101 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="340pt" height="27pt"
|
||||
viewBox="0.00 0.00 339.75 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="152.75,-19.25 73,-19.25 73,0 152.75,0 152.75,-19.25"/>
|
||||
<text text-anchor="middle" x="112.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">struzik_search</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.31,-9.62C44.31,-9.62 52.73,-9.62 61.35,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.19,-13.13 71.19,-9.63 61.19,-6.13 61.19,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="241.5,-19.25 188.75,-19.25 188.75,0 241.5,0 241.5,-19.25"/>
|
||||
<text text-anchor="middle" x="215.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">binary_s</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M153.21,-9.62C161.08,-9.62 169.32,-9.62 177.1,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.95,-13.13 186.95,-9.63 176.95,-6.13 176.95,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/floor.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="331.75,-19.25 277.5,-19.25 277.5,0 331.75,0 331.75,-19.25"/>
|
||||
<text text-anchor="middle" x="304.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::floor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3_Node000003_Node000004" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M241.9,-9.62C249.36,-9.62 257.65,-9.62 265.68,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="265.61,-13.13 275.61,-9.63 265.61,-6.13 265.61,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="340pt" height="27pt"
|
||||
viewBox="0.00 0.00 339.75 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="152.75,-19.25 73,-19.25 73,0 152.75,0 152.75,-19.25"/>
|
||||
<text text-anchor="middle" x="112.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">struzik_search</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.31,-9.62C44.31,-9.62 52.73,-9.62 61.35,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.19,-13.13 71.19,-9.63 61.19,-6.13 61.19,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="241.5,-19.25 188.75,-19.25 188.75,0 241.5,0 241.5,-19.25"/>
|
||||
<text text-anchor="middle" x="215.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">binary_s</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M153.21,-9.62C161.08,-9.62 169.32,-9.62 177.1,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="176.95,-13.13 186.95,-9.63 176.95,-6.13 176.95,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/floor.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="331.75,-19.25 277.5,-19.25 277.5,0 331.75,0 331.75,-19.25"/>
|
||||
<text text-anchor="middle" x="304.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::floor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3_Node000003_Node000004" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M241.9,-9.62C249.36,-9.62 257.65,-9.62 265.68,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="265.61,-13.13 275.61,-9.63 265.61,-6.13 265.61,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -1,7 +0,0 @@
|
||||
<map id="struzik_search" name="struzik_search">
|
||||
<area shape="rect" id="Node000001" title=" " alt="" coords="5,5,112,31"/>
|
||||
<area shape="rect" id="Node000002" href="$d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae" title=" " alt="" coords="160,5,230,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="112,16,144,16,144,21,112,21"/>
|
||||
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/numeric/math/floor.html#" title=" " alt="" coords="278,5,350,31"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="231,16,262,16,262,21,231,21"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
f8cdcc8009682d51680a49cb18b1d5ca
|
||||
@@ -1,83 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: struzik_search Pages: 1 -->
|
||||
<svg width="267pt" height="27pt"
|
||||
viewBox="0.00 0.00 266.75 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>struzik_search</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="79.75,-19.25 0,-19.25 0,0 79.75,0 79.75,-19.25"/>
|
||||
<text text-anchor="middle" x="39.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">struzik_search</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="168.5,-19.25 115.75,-19.25 115.75,0 168.5,0 168.5,-19.25"/>
|
||||
<text text-anchor="middle" x="142.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">binary_s</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M80.21,-9.62C88.08,-9.62 96.32,-9.62 104.1,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="103.95,-13.13 113.95,-9.63 103.95,-6.13 103.95,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/floor.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="258.75,-19.25 204.5,-19.25 204.5,0 258.75,0 258.75,-19.25"/>
|
||||
<text text-anchor="middle" x="231.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::floor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M168.9,-9.62C176.36,-9.62 184.65,-9.62 192.68,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="192.61,-13.13 202.61,-9.63 192.61,-6.13 192.61,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.2 KiB |
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: struzik_search Pages: 1 -->
|
||||
<svg width="267pt" height="27pt"
|
||||
viewBox="0.00 0.00 266.75 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>struzik_search</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="79.75,-19.25 0,-19.25 0,0 79.75,0 79.75,-19.25"/>
|
||||
<text text-anchor="middle" x="39.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">struzik_search</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="168.5,-19.25 115.75,-19.25 115.75,0 168.5,0 168.5,-19.25"/>
|
||||
<text text-anchor="middle" x="142.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">binary_s</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M80.21,-9.62C88.08,-9.62 96.32,-9.62 104.1,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="103.95,-13.13 113.95,-9.63 103.95,-6.13 103.95,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/numeric/math/floor.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="258.75,-19.25 204.5,-19.25 204.5,0 258.75,0 258.75,-19.25"/>
|
||||
<text text-anchor="middle" x="231.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::floor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M168.9,-9.62C176.36,-9.62 184.65,-9.62 192.68,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="192.61,-13.13 202.61,-9.63 192.61,-6.13 192.61,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
200
d8/d8a/exponential__search_8cpp_source.html
Normal file
200
d8/d8a/exponential__search_8cpp_source.html
Normal file
@@ -0,0 +1,200 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<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="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/exponential_search.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('d8/d8a/exponential__search_8cpp_source.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">exponential_search.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d8/d8a/exponential__search_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="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <cmath></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#ifdef _MSC_VER</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <string></span> <span class="comment">// use for MS Visual C++</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <cstring></span> <span class="comment">// for all other compilers</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">template</span> <<span class="keyword">class</span> Type></div>
|
||||
<div class="foldopen" id="foldopen00034" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae"> 34</a></span><span class="keyword">inline</span> Type* <a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae">binary_s</a>(Type* array, <span class="keywordtype">size_t</span> size, Type key) {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> int32_t lower_index(0), upper_index(size - 1), middle_index;</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">while</span> (lower_index <= upper_index) {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> middle_index = std::floor((lower_index + upper_index) / 2);</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">if</span> (*(array + middle_index) < key)</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> lower_index = (middle_index + 1);</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*(array + middle_index) > key)</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> upper_index = (middle_index - 1);</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">return</span> (array + middle_index);</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> }</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">template</span> <<span class="keyword">class</span> Type></div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208"> 59</a></span>Type* <a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208">struzik_search</a>(Type* array, <span class="keywordtype">size_t</span> size, Type key) {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> uint32_t block_front(0), block_size = size == 0 ? 0 : 1;</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">while</span> (block_front != block_size) {</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">if</span> (*(array + block_size - 1) < key) {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> block_front = block_size;</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> (block_size * 2 - 1 < size) ? (block_size *= 2) : block_size = size;</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">continue</span>;</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae">binary_s<Type></a>(array + block_front, (block_size - block_front),</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> key);</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d8/d8a/exponential__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 74</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// TEST CASES</span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">int</span>* sorted_array = <span class="keyword">new</span> <span class="keywordtype">int</span>[7]{7, 10, 15, 23, 70, 105, 203};</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> assert(<a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208">struzik_search<int></a>(sorted_array, 7, 0) == <span class="keyword">nullptr</span>);</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> assert(<a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208">struzik_search<int></a>(sorted_array, 7, 1000) == <span class="keyword">nullptr</span>);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> assert(<a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208">struzik_search<int></a>(sorted_array, 7, 50) == <span class="keyword">nullptr</span>);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> assert(<a class="code hl_function" href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208">struzik_search<int></a>(sorted_array, 7, 7) == sorted_array);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// TEST CASES</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">delete</span>[] sorted_array;</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_ab06cedad209456eae95d37b7cd66acae"><div class="ttname"><a href="../../d8/d8a/exponential__search_8cpp.html#ab06cedad209456eae95d37b7cd66acae">binary_s</a></div><div class="ttdeci">Type * binary_s(Type *array, size_t size, Type key)</div><div class="ttdef"><b>Definition</b> <a href="#l00034">exponential_search.cpp:34</a></div></div>
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d8/d8a/exponential__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00074">exponential_search.cpp:74</a></div></div>
|
||||
<div class="ttc" id="aexponential__search_8cpp_html_af421bf4b7b95f20ac86c233adfdb9208"><div class="ttname"><a href="../../d8/d8a/exponential__search_8cpp.html#af421bf4b7b95f20ac86c233adfdb9208">struzik_search</a></div><div class="ttdeci">Type * struzik_search(Type *array, size_t size, Type key)</div><div class="ttdef"><b>Definition</b> <a href="#l00059">exponential_search.cpp:59</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><a class="el" href="../../d8/d8a/exponential__search_8cpp.html">exponential_search.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>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user