mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-10 05:56:58 +08:00
Documentation for db149bf3b7
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<!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">
|
||||
<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.9.4"/>
|
||||
<meta name="generator" content="Doxygen 1.9.5"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: sorting/pancake_sort.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,10 +41,10 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.4 -->
|
||||
<!-- Generated by Doxygen 1.9.5 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
@@ -84,9 +84,16 @@ $(document).ready(function(){initNavTree('d3/d92/pancake__sort_8cpp.html','../..
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
<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">
|
||||
@@ -106,7 +113,7 @@ $(document).ready(function(){initNavTree('d3/d92/pancake__sort_8cpp.html','../..
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for pancake_sort.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d38/pancake__sort_8cpp__incl.svg" width="355" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d38/pancake__sort_8cpp__incl.svg" width="355" height="110"><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">
|
||||
@@ -141,10 +148,10 @@ Functions</h2></td></tr>
|
||||
<p >Unlike a traditional sorting algorithm, which attempts to sort with the fewest comparisons possible, the goal is to sort the sequence in as few reversals as possible. Overall time complexity of pancake sort is O(n^2) For example: example 1:- Disordered pancake sizes: {2,5,3,7,8} Sorted: {2,3,5,7,8} For example: example 2:- Disordered pancake sizes: {22,51,37,73,81} Sorted: {22,37,51,73,81} </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/divyansh12323" target="_blank">Divyansh Gupta</a> </dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd>more on <a href="https://en.wikipedia.org/wiki/Pancake_sorting" target="_blank">Pancake sort</a> </dd>
|
||||
<dd>
|
||||
related <a class="el" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#abaeae8f62a018d197f0187a1c80a90fe" title="Problem statement for a system with first-order differential equations. Updates the system differenti...">problem</a> at <a href="https://leetcode.com/problems/pancake-sorting/" target="_blank">Leetcode</a> </dd></dl>
|
||||
related <a class="el" href="../../db/dd3/ode__forward__euler_8cpp.html#abaeae8f62a018d197f0187a1c80a90fe" title="Problem statement for a system with first-order differential equations. Updates the system differenti...">problem</a> at <a href="https://leetcode.com/problems/pancake-sorting/" target="_blank">Leetcode</a> </dd></dl>
|
||||
</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>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -169,14 +176,14 @@ related <a class="el" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#ab
|
||||
</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="../../d3/d92/pancake__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="324" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d92/pancake__sort_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="324" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="abff90bc0f54e4f8ea5f0330471781bd5" name="abff90bc0f54e4f8ea5f0330471781bd5"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#abff90bc0f54e4f8ea5f0330471781bd5">◆ </a></span>pancakeSort()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#abff90bc0f54e4f8ea5f0330471781bd5">◆ </a></span>pancakeSort()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -234,14 +241,14 @@ template<typename T > </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="../../d3/d92/pancake__sort_8cpp_abff90bc0f54e4f8ea5f0330471781bd5_cgraph.svg" width="158" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d92/pancake__sort_8cpp_abff90bc0f54e4f8ea5f0330471781bd5_cgraph.svg" width="158" height="75"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a99e27ad84ad43df9977776b1a8d5416e" name="a99e27ad84ad43df9977776b1a8d5416e"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a99e27ad84ad43df9977776b1a8d5416e">◆ </a></span>reverse()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a99e27ad84ad43df9977776b1a8d5416e">◆ </a></span>reverse()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -299,7 +306,7 @@ template<typename T > </div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -366,11 +373,11 @@ template<typename T > </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="ais_sorted_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a></div><div class="ttdeci">T is_sorted(T... args)</div></div>
|
||||
<div class="ttc" id="apancake__sort_8cpp_html_abff90bc0f54e4f8ea5f0330471781bd5"><div class="ttname"><a href="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5">sorting::pancake_sort::pancakeSort</a></div><div class="ttdeci">int pancakeSort(std::vector< T > &arr, int size)</div><div class="ttdoc">This implementation is for a C-style array input that gets modified in place.</div><div class="ttdef"><b>Definition:</b> pancake_sort.cpp:61</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector< int ></a></div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></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="../../d3/d92/pancake__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="226" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d92/pancake__sort_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="226" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -382,7 +389,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="../../d3/d92/pancake__sort_8cpp.html">pancake_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.4 </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>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user