mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-23 21:32:09 +08:00
Documentation for 0931d530ae
This commit is contained in:
@@ -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/comb_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&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -127,7 +127,7 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </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/Comb_sort" target="_blank">Comb Sort Algorithm (Comb Sort)</a> </p>
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Comb_sort" target="_blank">Comb Sort Algorithm (Comb Sort)</a> </p>
|
||||
<dl class="section author"><dt>Author</dt><dd></dd></dl>
|
||||
<ul>
|
||||
<li>A better version of bubble sort algorithm</li>
|
||||
@@ -166,7 +166,7 @@ Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Function to sort array</p>
|
||||
<p>Function to sort array</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">arr</td><td>array to be sorted </td></tr>
|
||||
@@ -175,11 +175,11 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p >initial gap will be maximum and the maximum possible value is the size of the array that is n and which is equal to r in this case so to avoid passing an extra parameter n that is the size of the array we are using r to initialize the initial gap.</p>
|
||||
<p >Initialize swapped as true to make sure that loop runs</p>
|
||||
<p >Keep running until gap = 1 or none elements were swapped</p>
|
||||
<p >Find next gap</p>
|
||||
<p ><a class="el" href="../../de/d4a/class_compare.html" title="Comparator class for priority queue.">Compare</a> all elements with current gap</p>
|
||||
<p>initial gap will be maximum and the maximum possible value is the size of the array that is n and which is equal to r in this case so to avoid passing an extra parameter n that is the size of the array we are using r to initialize the initial gap.</p>
|
||||
<p>Initialize swapped as true to make sure that loop runs</p>
|
||||
<p>Keep running until gap = 1 or none elements were swapped</p>
|
||||
<p>Find next gap</p>
|
||||
<p><a class="el" href="../../de/d4a/class_compare.html" title="Comparator class for priority queue.">Compare</a> all elements with current gap</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 42</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 43</span><span class="comment"> /**</span></div>
|
||||
<div class="line"><span class="lineno"> 44</span><span class="comment"> *</span></div>
|
||||
@@ -236,7 +236,7 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Find the next gap by shrinking the current gap by shrink factor of 1.3 </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<p>Find the next gap by shrinking the current gap by shrink factor of 1.3 </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">gap</td><td>current gap </td></tr>
|
||||
</table>
|
||||
@@ -273,9 +273,9 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Main function </p>
|
||||
<p >Running predefined tests</p>
|
||||
<p >For user interaction</p>
|
||||
<p>Main function </p>
|
||||
<p>Running predefined tests</p>
|
||||
<p>For user interaction</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 89</span><span class="comment"> /// Running predefined tests</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span><span class="comment"></span> <a class="code hl_function" href="../../d9/dfd/comb__sort_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
@@ -317,8 +317,8 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Test 1</p>
|
||||
<p >Test 2</p>
|
||||
<p>Test 1</p>
|
||||
<p>Test 2</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 73</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 74</span><span class="comment"> /// Test 1</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span><span class="comment"></span> <span class="keywordtype">int</span> arr1[10] = {34, 56, 6, 23, 76, 34, 76, 343, 4, 76};</div>
|
||||
@@ -348,7 +348,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="../../d9/dfd/comb__sort_8cpp.html">comb_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>
|
||||
|
||||
Reference in New Issue
Block a user