mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-01 05:53:30 +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++: backtracking/minimax.cpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: backtracking/minimax.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>
|
||||
@@ -122,7 +139,9 @@ Include dependency graph for minimax.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d36/minimax_8cpp__incl.svg" width="336" height="111"><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="../../df/dfb/minimax_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="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html">backtracking</a></td></tr>
|
||||
@@ -132,7 +151,7 @@ Namespaces</h2></td></tr>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a78540bcb5ef3473b2348cbc34748ec50" id="r_a78540bcb5ef3473b2348cbc34748ec50"><td class="memTemplParams" colspan="2">template<size_t T> </td></tr>
|
||||
<tr class="memitem:a78540bcb5ef3473b2348cbc34748ec50"><td class="memTemplItemLeft" align="right" valign="top">int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a> (int depth, int node_index, bool is_max, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>< int, T > &scores, double <a class="el" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>)</td></tr>
|
||||
<tr class="memitem:a78540bcb5ef3473b2348cbc34748ec50"><td class="memTemplItemLeft" align="right" valign="top">int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a> (int depth, int node_index, bool is_max, const std::array< int, T > &scores, double <a class="el" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>)</td></tr>
|
||||
<tr class="memdesc:a78540bcb5ef3473b2348cbc34748ec50"><td class="mdescLeft"> </td><td class="mdescRight">Check which is the maximum/minimum number in the array. <br /></td></tr>
|
||||
<tr class="separator:a78540bcb5ef3473b2348cbc34748ec50"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
@@ -145,6 +164,8 @@ Functions</h2></td></tr>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/gleisonbs" target="_blank">Gleison Batista</a> </dd>
|
||||
<dd>
|
||||
<a href="https://github.com/Panquesito7" target="_blank">David Leal</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../df/dfb/minimax_8cpp_source.html">minimax.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
@@ -163,26 +184,19 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/dfb/minimax_8cpp_source.html#l00056">56</a> of file <a class="el" href="../../df/dfb/minimax_8cpp_source.html">minimax.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 56</span> {</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array<int, 8></a> scores = {90, 23, 6, 33, 21, 65, 123, 34423};</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a> = log2(scores.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array/size.html">size</a>());</div>
|
||||
<div class="line"><span class="lineno"> 57</span> std::array<int, 8> scores = {90, 23, 6, 33, 21, 65, 123, 34423};</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a> = log2(scores.size());</div>
|
||||
<div class="line"><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><span class="lineno"> 60</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Optimal value: "</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> << <a class="code hl_function" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a>(0, 0, <span class="keyword">true</span>, scores, <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> std::cout << <span class="stringliteral">"Optimal value: "</span></div>
|
||||
<div class="line"><span class="lineno"> 61</span> << <a class="code hl_function" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a>(0, 0, <span class="keyword">true</span>, scores, <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>) << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 62</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 63</span>}</div>
|
||||
<div class="ttc" id="aarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a></div></div>
|
||||
<div class="ttc" id="aavltree_8cpp_html_ae4a66d8b0c2b0d626aea45977e358c83"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a></div><div class="ttdeci">int height(node *root)</div><div class="ttdef"><b>Definition</b> avltree.cpp:38</div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacebacktracking_html_a78540bcb5ef3473b2348cbc34748ec50"><div class="ttname"><a href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a></div><div class="ttdeci">int minimax(int depth, int node_index, bool is_max, const std::array< int, T > &scores, double height)</div><div class="ttdoc">Check which is the maximum/minimum number in the array.</div><div class="ttdef"><b>Definition</b> minimax.cpp:39</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array/size.html">std::array::size</a></div><div class="ttdeci">T size(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="../../df/dfb/minimax_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="498" height="211"><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="aavltree_8cpp_html_ae4a66d8b0c2b0d626aea45977e358c83"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a></div><div class="ttdeci">int height(node *root)</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00038">avltree.cpp:38</a></div></div>
|
||||
<div class="ttc" id="anamespacebacktracking_html_a78540bcb5ef3473b2348cbc34748ec50"><div class="ttname"><a href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a></div><div class="ttdeci">int minimax(int depth, int node_index, bool is_max, const std::array< int, T > &scores, double height)</div><div class="ttdoc">Check which is the maximum/minimum number in the array.</div><div class="ttdef"><b>Definition</b> <a href="../../df/dfb/minimax_8cpp_source.html#l00039">minimax.cpp:39</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="Node000001" title="Main function." alt="" coords="5,93,55,119"/>
|
||||
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="143,5,214,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="44,91,70,70,101,48,128,34,130,39,104,52,73,74,48,95"/>
|
||||
<area shape="rect" id="Node000003" href="$d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83" title=" " alt="" coords="309,68,365,94"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="55,99,102,92,205,83,293,79,293,85,205,88,103,97,55,104"/>
|
||||
<area shape="rect" id="Node000005" href="$db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50" title="Check which is the maximum/minimum number in the array." alt="" coords="103,131,255,156"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000005" title=" " alt="" coords="55,110,111,124,110,129,54,115"/>
|
||||
<area shape="rect" id="Node000007" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/array/size.html#" title=" " alt="" coords="125,180,233,206"/>
|
||||
<area shape="poly" id="edge10_Node000001_Node000007" title=" " alt="" coords="45,118,71,142,104,167,113,171,111,176,101,171,67,146,41,121"/>
|
||||
<area shape="poly" id="edge3_Node000003_Node000003" title=" " alt="" coords="316,69,312,59,315,50,323,44,337,41,352,44,360,51,356,55,350,49,337,47,325,49,319,53,318,59,321,67"/>
|
||||
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="419,93,492,119"/>
|
||||
<area shape="poly" id="edge4_Node000003_Node000004" title=" " alt="" coords="366,84,405,93,404,98,365,89"/>
|
||||
<area shape="poly" id="edge6_Node000005_Node000003" title=" " alt="" coords="213,128,294,95,296,100,215,133"/>
|
||||
<area shape="poly" id="edge7_Node000005_Node000004" title=" " alt="" coords="255,131,403,110,404,116,256,136"/>
|
||||
<area shape="poly" id="edge9_Node000005_Node000005" title=" " alt="" coords="153,132,148,122,151,113,162,106,179,104,197,107,207,113,204,118,195,112,179,109,164,111,155,116,154,122,158,129"/>
|
||||
<area shape="rect" id="Node000006" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="303,169,371,195"/>
|
||||
<area shape="poly" id="edge8_Node000005_Node000006" title=" " alt="" coords="235,154,289,168,287,173,234,160"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
5733f15115d6a3b35636bada4c01d808
|
||||
@@ -1,191 +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="373pt" height="158pt"
|
||||
viewBox="0.00 0.00 372.75 158.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 154.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-84.25 0,-84.25 0,-65 37,-65 37,-84.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-70.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 target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="156.88,-150.25 103.38,-150.25 103.38,-131 156.88,-131 156.88,-150.25"/>
|
||||
<text text-anchor="middle" x="130.12" y="-136.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</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="M30.36,-84.55C40.75,-93.69 57.15,-107.24 73,-116.62 79.16,-120.28 85.98,-123.67 92.69,-126.69"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.05,-129.8 101.62,-130.52 93.8,-123.36 91.05,-129.8"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="270,-103.25 227.75,-103.25 227.75,-84 270,-84 270,-103.25"/>
|
||||
<text text-anchor="middle" x="248.88" y="-89.75" font-family="Helvetica,sans-Serif" font-size="10.00">height</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.26,-78.12C47.64,-80.03 61.02,-82.28 73,-83.62 122.74,-89.21 180.81,-91.75 215.94,-92.85"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="215.74,-96.34 225.84,-93.14 215.95,-89.35 215.74,-96.34"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50" target="_top" xlink:title="Check which is the maximum/minimum number in the array.">
|
||||
<polygon fill="white" stroke="#666666" points="187.25,-56.25 73,-56.25 73,-37 187.25,-37 187.25,-56.25"/>
|
||||
<text text-anchor="middle" x="130.12" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::minimax</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge5_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge5_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.11,-70.13C48.51,-67.22 63.97,-63.27 78.96,-59.44"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="79.44,-62.93 88.26,-57.06 77.71,-56.15 79.44,-62.93"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/array/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="170.75,-19.25 89.5,-19.25 89.5,0 170.75,0 170.75,-19.25"/>
|
||||
<text text-anchor="middle" x="130.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::array::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge10_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge10_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M28.43,-64.65C38.36,-54.1 55.36,-37.62 73,-27.62 75.21,-26.37 77.51,-25.2 79.88,-24.09"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="81.2,-27.33 89.1,-20.27 78.52,-20.87 81.2,-27.33"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node3 -->
|
||||
<g id="edge3_Node000003_Node000003" class="edge">
|
||||
<title>Node3->Node3</title>
|
||||
<g id="a_edge3_Node000003_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M234.98,-103.54C228.64,-112.15 233.27,-121.25 248.88,-121.25 257.41,-121.25 262.66,-118.53 264.63,-114.65"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="268.12,-114.32 263.02,-105.03 261.22,-115.47 268.12,-114.32"/>
|
||||
</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/algorithm/max.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="364.75,-84.25 310.5,-84.25 310.5,-65 364.75,-65 364.75,-84.25"/>
|
||||
<text text-anchor="middle" x="337.62" y="-70.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge4_Node000003_Node000004" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<g id="a_edge4_Node000003_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M270.43,-89.12C279,-87.25 289.24,-85 299.06,-82.85"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="299.79,-86.28 308.81,-80.72 298.29,-79.44 299.79,-86.28"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node3 -->
|
||||
<g id="edge6_Node000005_Node000003" class="edge">
|
||||
<title>Node5->Node3</title>
|
||||
<g id="a_edge6_Node000005_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M156.17,-56.71C173.98,-63.88 198.02,-73.55 217.01,-81.2"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="215.54,-84.38 226.13,-84.87 218.16,-77.89 215.54,-84.38"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge7_Node000005_Node000004" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<g id="a_edge7_Node000005_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M187.55,-54.31C222.95,-59.14 267.63,-65.22 298.8,-69.47"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="298.16,-72.92 308.54,-70.8 299.11,-65.98 298.16,-72.92"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge9_Node000005_Node000005" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<g id="a_edge9_Node000005_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M112.65,-56.54C104.68,-65.15 110.5,-74.25 130.12,-74.25 140.86,-74.25 147.46,-71.53 149.94,-67.65"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="153.4,-67.08 147.91,-58.02 146.55,-68.53 153.4,-67.08"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="274.5,-27.25 223.25,-27.25 223.25,-8 274.5,-8 274.5,-27.25"/>
|
||||
<text text-anchor="middle" x="248.88" y="-13.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge8_Node000005_Node000006" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<g id="a_edge8_Node000005_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M171.63,-36.56C184.74,-33.31 199.18,-29.72 211.94,-26.55"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="212.76,-29.95 221.62,-24.15 211.07,-23.16 212.76,-29.95"/>
|
||||
</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: 8.3 KiB |
@@ -1,165 +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="373pt" height="158pt"
|
||||
viewBox="0.00 0.00 372.75 158.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 154.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-84.25 0,-84.25 0,-65 37,-65 37,-84.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-70.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 target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="156.88,-150.25 103.38,-150.25 103.38,-131 156.88,-131 156.88,-150.25"/>
|
||||
<text text-anchor="middle" x="130.12" y="-136.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</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="M30.36,-84.55C40.75,-93.69 57.15,-107.24 73,-116.62 79.16,-120.28 85.98,-123.67 92.69,-126.69"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.05,-129.8 101.62,-130.52 93.8,-123.36 91.05,-129.8"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="270,-103.25 227.75,-103.25 227.75,-84 270,-84 270,-103.25"/>
|
||||
<text text-anchor="middle" x="248.88" y="-89.75" font-family="Helvetica,sans-Serif" font-size="10.00">height</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.26,-78.12C47.64,-80.03 61.02,-82.28 73,-83.62 122.74,-89.21 180.81,-91.75 215.94,-92.85"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="215.74,-96.34 225.84,-93.14 215.95,-89.35 215.74,-96.34"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50" target="_top" xlink:title="Check which is the maximum/minimum number in the array.">
|
||||
<polygon fill="white" stroke="#666666" points="187.25,-56.25 73,-56.25 73,-37 187.25,-37 187.25,-56.25"/>
|
||||
<text text-anchor="middle" x="130.12" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::minimax</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge5_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge5_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.11,-70.13C48.51,-67.22 63.97,-63.27 78.96,-59.44"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="79.44,-62.93 88.26,-57.06 77.71,-56.15 79.44,-62.93"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/array/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="170.75,-19.25 89.5,-19.25 89.5,0 170.75,0 170.75,-19.25"/>
|
||||
<text text-anchor="middle" x="130.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::array::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge10_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge10_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M28.43,-64.65C38.36,-54.1 55.36,-37.62 73,-27.62 75.21,-26.37 77.51,-25.2 79.88,-24.09"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="81.2,-27.33 89.1,-20.27 78.52,-20.87 81.2,-27.33"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node3 -->
|
||||
<g id="edge3_Node000003_Node000003" class="edge">
|
||||
<title>Node3->Node3</title>
|
||||
<g id="a_edge3_Node000003_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M234.98,-103.54C228.64,-112.15 233.27,-121.25 248.88,-121.25 257.41,-121.25 262.66,-118.53 264.63,-114.65"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="268.12,-114.32 263.02,-105.03 261.22,-115.47 268.12,-114.32"/>
|
||||
</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/algorithm/max.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="364.75,-84.25 310.5,-84.25 310.5,-65 364.75,-65 364.75,-84.25"/>
|
||||
<text text-anchor="middle" x="337.62" y="-70.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge4_Node000003_Node000004" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<g id="a_edge4_Node000003_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M270.43,-89.12C279,-87.25 289.24,-85 299.06,-82.85"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="299.79,-86.28 308.81,-80.72 298.29,-79.44 299.79,-86.28"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node3 -->
|
||||
<g id="edge6_Node000005_Node000003" class="edge">
|
||||
<title>Node5->Node3</title>
|
||||
<g id="a_edge6_Node000005_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M156.17,-56.71C173.98,-63.88 198.02,-73.55 217.01,-81.2"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="215.54,-84.38 226.13,-84.87 218.16,-77.89 215.54,-84.38"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge7_Node000005_Node000004" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<g id="a_edge7_Node000005_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M187.55,-54.31C222.95,-59.14 267.63,-65.22 298.8,-69.47"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="298.16,-72.92 308.54,-70.8 299.11,-65.98 298.16,-72.92"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge9_Node000005_Node000005" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<g id="a_edge9_Node000005_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M112.65,-56.54C104.68,-65.15 110.5,-74.25 130.12,-74.25 140.86,-74.25 147.46,-71.53 149.94,-67.65"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="153.4,-67.08 147.91,-58.02 146.55,-68.53 153.4,-67.08"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="274.5,-27.25 223.25,-27.25 223.25,-8 274.5,-8 274.5,-27.25"/>
|
||||
<text text-anchor="middle" x="248.88" y="-13.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge8_Node000005_Node000006" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<g id="a_edge8_Node000005_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M171.63,-36.56C184.74,-33.31 199.18,-29.72 211.94,-26.55"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="212.76,-29.95 221.62,-24.15 211.07,-23.16 212.76,-29.95"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.5 KiB |
174
df/dfb/minimax_8cpp_source.html
Normal file
174
df/dfb/minimax_8cpp_source.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<!-- 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++: backtracking/minimax.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('df/dfb/minimax_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">minimax.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../df/dfb/minimax_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="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <array></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../db/dc0/namespacebacktracking.html">backtracking</a> {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> T></div>
|
||||
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50"> 39</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">minimax</a>(<span class="keywordtype">int</span> depth, <span class="keywordtype">int</span> node_index, <span class="keywordtype">bool</span> is_max,</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">const</span> std::array<int, T> &scores, <span class="keywordtype">double</span> <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>) {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">if</span> (depth == <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>) {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">return</span> scores[node_index];</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">int</span> v1 = <a class="code hl_function" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">minimax</a>(depth + 1, node_index * 2, !is_max, scores, <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>);</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">int</span> v2 = <a class="code hl_function" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">minimax</a>(depth + 1, node_index * 2 + 1, !is_max, scores, <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>);</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> is_max ? std::max(v1, v2) : std::min(v1, v2);</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>} <span class="comment">// namespace backtracking</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="foldopen" id="foldopen00056" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="../../df/dfb/minimax_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 56</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/dfb/minimax_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> std::array<int, 8> scores = {90, 23, 6, 33, 21, 65, 123, 34423};</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a> = log2(scores.size());</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::cout << <span class="stringliteral">"Optimal value: "</span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> << <a class="code hl_function" href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a>(0, 0, <span class="keyword">true</span>, scores, <a class="code hl_function" href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a>) << std::endl;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="aavltree_8cpp_html_ae4a66d8b0c2b0d626aea45977e358c83"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#ae4a66d8b0c2b0d626aea45977e358c83">height</a></div><div class="ttdeci">int height(node *root)</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00038">avltree.cpp:38</a></div></div>
|
||||
<div class="ttc" id="aminimax_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/dfb/minimax_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00056">minimax.cpp:56</a></div></div>
|
||||
<div class="ttc" id="anamespacebacktracking_html"><div class="ttname"><a href="../../db/dc0/namespacebacktracking.html">backtracking</a></div><div class="ttdoc">for vector container</div></div>
|
||||
<div class="ttc" id="anamespacebacktracking_html_a78540bcb5ef3473b2348cbc34748ec50"><div class="ttname"><a href="../../db/dc0/namespacebacktracking.html#a78540bcb5ef3473b2348cbc34748ec50">backtracking::minimax</a></div><div class="ttdeci">int minimax(int depth, int node_index, bool is_max, const std::array< int, T > &scores, double height)</div><div class="ttdoc">Check which is the maximum/minimum number in the array.</div><div class="ttdef"><b>Definition</b> <a href="#l00039">minimax.cpp:39</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_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../df/dfb/minimax_8cpp.html">minimax.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