Documentation for 78fbb40e9d

This commit is contained in:
github-actions
2020-10-14 21:20:48 +00:00
parent 5373838f24
commit 017448e6ad
180 changed files with 6108 additions and 5947 deletions

View File

@@ -136,7 +136,7 @@ Functions</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of cutting a rod problem. </p>
<p>Given a rod of length n inches and an array of prices that contains prices of all pieces of size&lt;=n. Determine the maximum profit obtainable by cutting up the rod and selling the pieces.</p>
<h3><a class="anchor" id="autotoc_md43"></a>
<h3><a class="anchor" id="autotoc_md50"></a>
Algorithm</h3>
<p>The idea is to break the given rod into every smaller piece as possible and then check profit for each piece, by calculating maximum profit for smaller pieces we will build the solution for larger pieces in bottom-up manner.</p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Anmol3299">Anmol</a> </dd>

View File

@@ -94,12 +94,12 @@ $(document).ready(function(){initNavTree('d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.htm
<div class="title">CONTRIBUTION GUIDELINES </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="autotoc_md4"></a>
<div class="textblock"><h1><a class="anchor" id="autotoc_md11"></a>
Before contributing</h1>
<p>Welcome to <a href="https://github.com/TheAlgorithms/C-Plus-Plus">TheAlgorithms/C-Plus-Plus</a>! Before submitting pull requests, please make sure that you have <b>read the whole guidelines</b>. If you have any doubts about this contribution guide, please open <a href="https://github.com/TheAlgorithms/C-Plus-Plus/issues/new/choose">an issue</a> and clearly state your concerns.</p>
<h1><a class="anchor" id="autotoc_md5"></a>
<h1><a class="anchor" id="autotoc_md12"></a>
Contributing</h1>
<h2><a class="anchor" id="autotoc_md6"></a>
<h2><a class="anchor" id="autotoc_md13"></a>
Contributor</h2>
<p>We are very happy that you consider implementing algorithms and data structures for others! This repository is referred to and used by learners from around the globe. Being one of our contributors, you agree and confirm that:</p><ul>
<li>You did your own work.<ul>
@@ -112,9 +112,9 @@ Contributor</h2>
<p><b>New implementation</b> New implementation are welcome!</p>
<p><b>Improving comments</b> and <b>adding tests</b> to existing algorithms are much appreciated.</p>
<p><b>Issues</b> Please avoid opening issues asking to be "assigned” to a particular algorithm. This merely creates unnecessary noise for maintainers. Instead, please submit your implementation in a pull request and it will be evaluated by project maintainers.</p>
<h2><a class="anchor" id="autotoc_md7"></a>
<h2><a class="anchor" id="autotoc_md14"></a>
Making Changes</h2>
<h3><a class="anchor" id="autotoc_md8"></a>
<h3><a class="anchor" id="autotoc_md15"></a>
Code</h3>
<ul>
<li>Please use the directory structure of the repository.</li>
@@ -129,7 +129,7 @@ Code</h3>
<li>Please conform to <a href="https://www.doxygen.nl/manual/docblocks.html">doxygen</a> standard and document the code as much as possible. This not only facilitates the readers but also generates the correct info on website.</li>
<li><b>Be consistent in use of these guidelines.</b></li>
</ul>
<h3><a class="anchor" id="autotoc_md9"></a>
<h3><a class="anchor" id="autotoc_md16"></a>
Documentation</h3>
<ul>
<li>Make sure you put useful comments in your code. Do not comment things that are obvious.</li>
@@ -138,14 +138,14 @@ Documentation</h3>
<li>Do not update README.md along with other changes, first create an issue and then link to that issue in your pull request to suggest specific changes required to README.md</li>
<li>The repository follows <a href="https://www.doxygen.nl/manual/docblocks.html">Doxygen</a> standards and auto-generates the <a href="https://thealgorithms.github.io/C-Plus-Plus">repo website</a>. Please ensure the code is documented in this structure. Sample implementation is given below.</li>
</ul>
<h3><a class="anchor" id="autotoc_md10"></a>
<h3><a class="anchor" id="autotoc_md17"></a>
Test</h3>
<ul>
<li>Make sure to add examples and test cases in your <a class="el" href="../../d3/d40/graph__coloring_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a> function.</li>
<li>If you find any algorithm or document without tests, please feel free to create a pull request or issue describing suggested changes.</li>
<li>Please try to add one or more <code><a class="el" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test()</a></code> functions that will invoke the algorithm implementation on random test data with expected output. Use <code>assert()</code> function to confirm that the tests will pass.</li>
</ul>
<h3><a class="anchor" id="autotoc_md11"></a>
<h3><a class="anchor" id="autotoc_md18"></a>
Typical structure of a program:</h3>
<div class="fragment"><div class="line"><span class="comment">/**</span></div>
<div class="line"><span class="comment"> * @file </span></div>
@@ -209,7 +209,7 @@ Typical structure of a program:</h3>
<div class="line"> <span class="comment">// code here</span></div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md12"></a>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md19"></a>
New File Name guidelines</h3>
<ul>
<li>Use lowercase words with <code>"_"</code> as separator</li>
@@ -220,7 +220,7 @@ New File Name guidelines</h3>
<li>File name validation will run on docker to ensure the validity.</li>
<li>If an implementation of the algorithm already exists and your version is different from that implemented, please use incremental numeric digit as a suffix. For example, if <code><a class="el" href="../../d9/d69/median__search_8cpp.html" title="Implementation of Median search algorithm. @cases from here">median_search.cpp</a></code> already exists in the <code>search</code> folder and you are contributing a new implementation, the filename should be <code>median_search2.cpp</code> and for a third implementation, <code>median_search3.cpp</code>.</li>
</ul>
<h3><a class="anchor" id="autotoc_md13"></a>
<h3><a class="anchor" id="autotoc_md20"></a>
New Directory guidelines</h3>
<ul>
<li>We recommend adding files to existing directories as much as possible.</li>
@@ -231,7 +231,7 @@ New Directory guidelines</h3>
<li>Filepaths will be used to dynamically create a directory of our algorithms.</li>
<li>Filepath validation will run on GitHub Actions to ensure compliance.</li>
</ul>
<h3><a class="anchor" id="autotoc_md14"></a>
<h3><a class="anchor" id="autotoc_md21"></a>
Commit Guidelines</h3>
<ul>
<li>It is recommended to keep your changes grouped logically within individual commits. Maintainers find it easier to understand changes that are logically spilt across multiple commits. Try to modify just one or two files in the same directory. Pull requests that span multiple directories are often rejected. <div class="fragment"><div class="line">git add file_xyz.cpp</div>
@@ -248,18 +248,18 @@ Commit Guidelines</h3>
<li>docs: Documentation changes</li>
<li>test: Correct existing tests or add new ones</li>
</ul>
<h2><a class="anchor" id="autotoc_md15"></a>
<h2><a class="anchor" id="autotoc_md22"></a>
Pull Requests</h2>
<ul>
<li>Checkout our <a href="https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/.github/pull_request_template.md">pull request template</a></li>
</ul>
<h3><a class="anchor" id="autotoc_md16"></a>
<h3><a class="anchor" id="autotoc_md23"></a>
Building Locally</h3>
<p>Before submitting a pull request, build the code locally or using the convenient <a href="https://gitpod.io/#https://github.com/TheAlgorithms/C-Plus-Plus"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code" class="inline"/></a> service. </p><div class="fragment"><div class="line">cmake -B build -S .</div>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md17"></a>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md24"></a>
Static Code Analyzer</h3>
<p>We use <a href="https://clang.llvm.org/extra/clang-tidy/">clang-tidy</a> as a static code analyzer with a configuration in <a href="../../.clang-tidy">.clang-tidy</a>. </p><div class="fragment"><div class="line">clang-tidy --fix --quiet -p build subfolder/file_to_check.cpp --</div>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md18"></a>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md25"></a>
Code Formatter</h3>
<p><a href="https://clang.llvm.org/docs/ClangFormat.html"><b>clang-format</b></a> is used for code forrmating.</p><ul>
<li>Installation (Only needs to be installed once.)<ul>
@@ -271,7 +271,7 @@ Code Formatter</h3>
</li>
<li>Running (all platforms): <code>clang-format -i -style="file" my_file.cpp</code></li>
</ul>
<h3><a class="anchor" id="autotoc_md19"></a>
<h3><a class="anchor" id="autotoc_md26"></a>
GitHub Actions</h3>
<p>Enable GitHub Actions on your fork of the repository. After enabling it will execute <code>clang-tidy</code> and <code>clang-format</code> after every a push (not a commit). The result can create another commit if the actions made any changes on your behalf. Hence, it is better to wait and check the results of GitHub Actions after every push. Run <code>git pull</code> in your local clone if these actions made many changes in order to avoid merge conflicts.</p>
<p>Most importantly,</p><ul>