Documentation for db3f9d3406

This commit is contained in:
realstealthninja
2024-10-28 15:53:44 +00:00
parent fe2cc4c065
commit 4b0a624473
93 changed files with 1589 additions and 328 deletions

View File

@@ -315,7 +315,7 @@ Functions</h2></td></tr>
<p>for assert for integral types for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a> for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></p>
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> and <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> for assert</p>
<p>Given a recurrence relation; evaluate the value of nth term. For e.g., For fibonacci series, recurrence series is <code>f(n) = f(n-1) + f(n-2)</code> where <code>f(0) = 0</code> and <code>f(1) = 1</code>. Note that the method used only demonstrates recurrence relation with one variable (n), unlike <code>nCr</code> problem, since it has two (n, r)</p>
<h3><a class="anchor" id="autotoc_md84"></a>
<h3><a class="anchor" id="autotoc_md85"></a>
Algorithm</h3>
<p>This problem can be solved using matrix exponentiation method. </p><dl class="section see"><dt>See also</dt><dd>here for simple <a href="https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/math/modular_exponentiation.cpp" target="_blank">number exponentiation algorithm</a> or <a href="https://en.wikipedia.org/wiki/Exponentiation_by_squaring" target="_blank">explaination here</a>. </dd></dl>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AshishYUO" target="_blank">Ashish Daulatabad</a> for assert for IO operations for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> STL</dd></dl>