<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://sibiwiki.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Countingsort</id>
	<title>Countingsort - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://sibiwiki.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Countingsort"/>
	<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Countingsort&amp;action=history"/>
	<updated>2026-11-27T02:28:45Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in sibiwiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Countingsort&amp;diff=55&amp;oldid=prev</id>
		<title>Akaibel: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Countingsort&amp;diff=55&amp;oldid=prev"/>
		<updated>2026-10-27T17:44:41Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 27. Oktober 2026, 17:44 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Akaibel</name></author>
	</entry>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Countingsort&amp;diff=54&amp;oldid=prev</id>
		<title>sibiwikialt&gt;Akaibel: /* Implementierung für Arrays */</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Countingsort&amp;diff=54&amp;oldid=prev"/>
		<updated>2022-01-23T17:55:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Implementierung für Arrays&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Kategorie: Sortierverfahren]]&lt;br /&gt;
[[Kategorie: Informatik]]&lt;br /&gt;
&lt;br /&gt;
=Verfahren=&lt;br /&gt;
Countingsort ist ein Sortierverfahren, das sich nur einsetzen lässt, wenn die Anzahl der möglichen Werte beschränkt ist, wie z.B. beim Sortieren von Postleitzahlen (es gibt nur 99.999 verschiedene Werte).&lt;br /&gt;
&lt;br /&gt;
Für jeden möglichen Wert wird dann eine &amp;quot;Strichliste&amp;quot; angelegt; d.h. bei Postleitzahlen gäbe es 99.999 Strichlisten. Dann wird das zu sortierende Array durchlaufen und für jeden Eintrag ein Strich in der richtigen Strichliste gemacht.&lt;br /&gt;
&lt;br /&gt;
Sobald man das Array durchlaufen hat, geht man die Strichlisten der Reihe nach durch: Wenn z.B. bei der PLZ &amp;quot;1&amp;quot; fünf Striche und bei der PLZ &amp;quot;2&amp;quot; drei Striche sind, dann trägt man in das Ergebnisarray ein: 1-1-1-1-1-2-2-2.&lt;br /&gt;
&lt;br /&gt;
Wenn man das für alle Strichlisten macht, dann hat man das Array sortiert.&lt;br /&gt;
&lt;br /&gt;
=Laufzeit=&lt;br /&gt;
&lt;br /&gt;
Die Laufzeit ist &amp;#039;&amp;#039;&amp;#039;O(n + m)&amp;#039;&amp;#039;&amp;#039;, mit&lt;br /&gt;
&lt;br /&gt;
* n: Anzahl der zu sortierenden Elemente&lt;br /&gt;
* m: Größe des Wertebereichs (bei Postleitzahlen: 100.000)&lt;br /&gt;
&lt;br /&gt;
=Implementierung für Arrays=&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
    public void countingsort (int[] pZahlen)&lt;br /&gt;
    {&lt;br /&gt;
        int[] strichlisten = new int[100000];&lt;br /&gt;
        for(int i=0;i&amp;lt;pZahlen.length;i++)&lt;br /&gt;
        {&lt;br /&gt;
            int aktuellerWert;&lt;br /&gt;
            aktuellerWert = pZahlen[i];&lt;br /&gt;
            strichlisten[aktuellerWert] = strichlisten[aktuellerWert]+1;&lt;br /&gt;
        }&lt;br /&gt;
 &lt;br /&gt;
        int position=0;&lt;br /&gt;
        int anzahl=0;&lt;br /&gt;
 &lt;br /&gt;
        for(int i=0; i&amp;lt;strichlisten.length;i++)&lt;br /&gt;
        {&lt;br /&gt;
            anzahl = strichlisten[i];&lt;br /&gt;
            while(anzahl&amp;gt;0)&lt;br /&gt;
            {&lt;br /&gt;
                pZahlen[position] = i;&lt;br /&gt;
                anzahl = anzahl-1;&lt;br /&gt;
                position = position+1;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>sibiwikialt&gt;Akaibel</name></author>
	</entry>
</feed>