Documentation for 0931d530ae

This commit is contained in:
github-actions
2023-01-22 19:44:10 +00:00
parent a448f64699
commit b48f6e8671
2457 changed files with 9513 additions and 8691 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: sorting/quick_sort.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -131,30 +131,30 @@ Namespaces</h2></td></tr>
Functions</h2></td></tr>
<tr class="memitem:a1b2a2cc2d319240f3b65c5b2f479ed82"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a1b2a2cc2d319240f3b65c5b2f479ed82"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d1/d21/quick__sort_8cpp.html#a1b2a2cc2d319240f3b65c5b2f479ed82">sorting::quick_sort::partition</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *arr, const int &amp;low, const int &amp;high)</td></tr>
<tr class="memdesc:a1b2a2cc2d319240f3b65c5b2f479ed82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sorts the array taking the last element as pivot. <a href="../../d1/d21/quick__sort_8cpp.html#a1b2a2cc2d319240f3b65c5b2f479ed82">More...</a><br /></td></tr>
<tr class="memdesc:a1b2a2cc2d319240f3b65c5b2f479ed82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sorts the array taking the last element as pivot. <br /></td></tr>
<tr class="separator:a1b2a2cc2d319240f3b65c5b2f479ed82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e6213e8008356ac6eda9427f3f4b394"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5e6213e8008356ac6eda9427f3f4b394"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d1/d21/quick__sort_8cpp.html#a5e6213e8008356ac6eda9427f3f4b394">sorting::quick_sort::quick_sort</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; *arr, const int &amp;low, const int &amp;high)</td></tr>
<tr class="memdesc:a5e6213e8008356ac6eda9427f3f4b394"><td class="mdescLeft">&#160;</td><td class="mdescRight">the main function that implements Quick Sort. <a href="../../d1/d21/quick__sort_8cpp.html#a5e6213e8008356ac6eda9427f3f4b394">More...</a><br /></td></tr>
<tr class="memdesc:a5e6213e8008356ac6eda9427f3f4b394"><td class="mdescLeft">&#160;</td><td class="mdescRight">the main function that implements Quick Sort. <br /></td></tr>
<tr class="separator:a5e6213e8008356ac6eda9427f3f4b394"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53adad7e4d83e1495df25fe8dbb4cc05"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a53adad7e4d83e1495df25fe8dbb4cc05"><td class="memTemplItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d1/d21/quick__sort_8cpp.html#a53adad7e4d83e1495df25fe8dbb4cc05">sorting::quick_sort::quick_sort</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; arr, const int &amp;low, const int &amp;high)</td></tr>
<tr class="memdesc:a53adad7e4d83e1495df25fe8dbb4cc05"><td class="mdescLeft">&#160;</td><td class="mdescRight">the main function that implements Quick Sort. <a href="../../d1/d21/quick__sort_8cpp.html#a53adad7e4d83e1495df25fe8dbb4cc05">More...</a><br /></td></tr>
<tr class="memdesc:a53adad7e4d83e1495df25fe8dbb4cc05"><td class="mdescLeft">&#160;</td><td class="mdescRight">the main function that implements Quick Sort. <br /></td></tr>
<tr class="separator:a53adad7e4d83e1495df25fe8dbb4cc05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeccefcf6fcca62c54939c5ec9a93109b"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aeccefcf6fcca62c54939c5ec9a93109b"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d1/d21/quick__sort_8cpp.html#aeccefcf6fcca62c54939c5ec9a93109b">sorting::quick_sort::show</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; T &gt; &amp;arr, const int &amp;size)</td></tr>
<tr class="memdesc:aeccefcf6fcca62c54939c5ec9a93109b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to print the array contents. <a href="../../d1/d21/quick__sort_8cpp.html#aeccefcf6fcca62c54939c5ec9a93109b">More...</a><br /></td></tr>
<tr class="memdesc:aeccefcf6fcca62c54939c5ec9a93109b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to print the array contents. <br /></td></tr>
<tr class="separator:aeccefcf6fcca62c54939c5ec9a93109b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a483bb8ccf42aaf7375a83e91490eda1e"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d21/quick__sort_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a> ()</td></tr>
<tr class="memdesc:a483bb8ccf42aaf7375a83e91490eda1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementations. <a href="../../d1/d21/quick__sort_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">More...</a><br /></td></tr>
<tr class="memdesc:a483bb8ccf42aaf7375a83e91490eda1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementations. <br /></td></tr>
<tr class="separator:a483bb8ccf42aaf7375a83e91490eda1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d21/quick__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <a href="../../d1/d21/quick__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p ><a href="https://en.wikipedia.org/wiki/Quicksort" target="_blank">Quick sort implementation</a> in C++ </p>
<p >Quick Sort is a <a href="https://en.wikipedia.org/wiki/Category:Divide-and-conquer_algorithms" target="_blank">divide and conquer algorithm</a>. It picks an element as pivot and partition the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways. </p><pre class="fragment"> 1. Always pick the first element as pivot
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Quicksort" target="_blank">Quick sort implementation</a> in C++ </p>
<p>Quick Sort is a <a href="https://en.wikipedia.org/wiki/Category:Divide-and-conquer_algorithms" target="_blank">divide and conquer algorithm</a>. It picks an element as pivot and partition the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways. </p><pre class="fragment"> 1. Always pick the first element as pivot
2. Always pick the last element as pivot (implemented below)
3. Pick a random element as pivot
4. Pick median as pivot
@@ -276,7 +276,7 @@ template&lt;typename T &gt; </div>
</div><div class="memdoc">
<p>Sorts the array taking the last element as pivot. </p>
<p >This function takes last element as pivot, places the pivot element at its correct position in sorted array, and places all smaller (smaller than pivot) to left of pivot and all greater elements to right of pivot </p><dl class="tparams"><dt>Template Parameters</dt><dd>
<p>This function takes last element as pivot, places the pivot element at its correct position in sorted array, and places all smaller (smaller than pivot) to left of pivot and all greater elements to right of pivot </p><dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">T</td><td>array type </td></tr>
</table>
@@ -352,7 +352,7 @@ template&lt;typename T &gt; </div>
</div><div class="memdoc">
<p>the main function that implements Quick Sort. </p>
<p >Void function used in T (array type) function, which then can be used as self-tests or other functionalities. </p><dl class="tparams"><dt>Template Parameters</dt><dd>
<p>Void function used in T (array type) function, which then can be used as self-tests or other functionalities. </p><dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">T</td><td>array type </td></tr>
</table>
@@ -414,7 +414,7 @@ template&lt;typename T &gt; </div>
</div><div class="memdoc">
<p>the main function that implements Quick Sort. </p>
<p >T (array type) function which calls the void function. Can be used for self-tests and other functionalities. </p><dl class="tparams"><dt>Template Parameters</dt><dd>
<p>T (array type) function which calls the void function. Can be used for self-tests and other functionalities. </p><dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">T</td><td>array type </td></tr>
</table>
@@ -590,7 +590,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d1/d21/quick__sort_8cpp.html">quick_sort.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.9.5 </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.9.6 </li>
</ul>
</div>
</body>