<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[next_permutationen]]></title><description><![CDATA[<p>hi,</p>
<p>wie funktioniert next_permutation?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/160793/next_permutationen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 14:30:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/160793.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Sep 2006 11:56:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 11:56:15 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>wie funktioniert next_permutation?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1146509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146509</guid><dc:creator><![CDATA[perlmut]]></dc:creator><pubDate>Fri, 29 Sep 2006 11:56:15 GMT</pubDate></item><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 11:57:36 GMT]]></title><description><![CDATA[<p><a href="http://www.sgi.com/tech/stl/next_permutation.html" rel="nofollow">http://www.sgi.com/tech/stl/next_permutation.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1146512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146512</guid><dc:creator><![CDATA[THX 1138]]></dc:creator><pubDate>Fri, 29 Sep 2006 11:57:36 GMT</pubDate></item><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 12:00:24 GMT]]></title><description><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Edith" rel="nofollow">edith:</a> wie schreibe ich eine eigene next_permutation - funktion?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1146513</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146513</guid><dc:creator><![CDATA[perlmut]]></dc:creator><pubDate>Fri, 29 Sep 2006 12:00:24 GMT</pubDate></item><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 12:10:29 GMT]]></title><description><![CDATA[<p>Aso...</p>
<p>Ändere die letzte Stelle von A bis Z.<br />
Setze die zweite eins weiter.<br />
Ändere die letzte Stelle von A bis Z.<br />
Setze die zweite eins weiter.<br />
...<br />
Setze die dritte eins weiter.<br />
...<br />
...<br />
...<br />
...<br />
Oder so ähnlich...</p>
<p>Grüsse<br />
Edith Piaf<br />
(was sollte der Link?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1146520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146520</guid><dc:creator><![CDATA[THX 1138]]></dc:creator><pubDate>Fri, 29 Sep 2006 12:10:29 GMT</pubDate></item><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 13:46:24 GMT]]></title><description><![CDATA[<p>äh, jo, das ist aber keine permutation sondern normalse &quot;zählen&quot;...<br />
ich brauche einen algo, der mir zu einer gegebenen permutation die &quot;nächste&quot; gibt, (wobei die nummerierung egal ist.) google gibt irgendwie nur hingefrickelte quelltexte ohne schöne erklärung her...</p>
<p>1310-Logik schrieb:</p>
<blockquote>
<p>Edith Piaf<br />
(was sollte der Link?)</p>
</blockquote>
<p>nichts, nur so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1146584</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146584</guid><dc:creator><![CDATA[perlmut]]></dc:creator><pubDate>Fri, 29 Sep 2006 13:46:24 GMT</pubDate></item><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 17:51:16 GMT]]></title><description><![CDATA[<p>Schau dir doch den Quelltest von next_permutation in deiner STL-Lib an. Erklärung gibt es da auch keine aber du hast einen Algorithmus.<br />
Hier hast du ja einen Algorithmus. Du mußt ihn nur noch programmieren.<br />
<a href="http://www.wiwi.uni-bielefeld.de/~wolf/lehre/ws0304/aud0304/nextperm/nextperm.html" rel="nofollow">http://www.wiwi.uni-bielefeld.de/~wolf/lehre/ws0304/aud0304/nextperm/nextperm.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1146711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146711</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 29 Sep 2006 17:51:16 GMT</pubDate></item><item><title><![CDATA[Reply to next_permutationen on Fri, 29 Sep 2006 20:16:00 GMT]]></title><description><![CDATA[<p>Kannst dir ja mal die Implementierung vom vc anschauen, die haben die funktionen immer mit ein paar Kommentaren versehen, allerdings sollte man zum tieferen Verständnis auch ruhig mal mit dem Debugger durch den Code durchgehen.</p>
<pre><code class="language-cpp">// TEMPLATE FUNCTION next_permutation
template&lt;class _BidIt&gt; inline
	bool next_permutation(_BidIt _First, _BidIt _Last)
	{	// permute and test for pure ascending, using operator&lt;
	_BidIt _Next = _Last;
	if (_First == _Last || _First == --_Next)
		return (false);

	for (; ; )
		{	// find rightmost element smaller than successor
		_BidIt _Next1 = _Next;
		if (*--_Next &lt; *_Next1)
			{	// swap with rightmost element that's smaller, flip suffix
			_BidIt _Mid = _Last;
			for (; !(*_Next &lt; *--_Mid); )
				;
			std::iter_swap(_Next, _Mid);
			std::reverse(_Next1, _Last);
			return (true);
			}

		if (_Next == _First)
			{	// pure descending, flip all
			std::reverse(_First, _Last);
			return (false);
			}
		}
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1146779</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1146779</guid><dc:creator><![CDATA[lolz]]></dc:creator><pubDate>Fri, 29 Sep 2006 20:16:00 GMT</pubDate></item></channel></rss>