<?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=Queue_neu</id>
	<title>Queue neu - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://sibiwiki.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Queue_neu"/>
	<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;action=history"/>
	<updated>2026-04-27T03:49:50Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in SibiWiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;diff=1989&amp;oldid=prev</id>
		<title>Mgrifka: Die Seite wurde geleert.</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;diff=1989&amp;oldid=prev"/>
		<updated>2015-09-02T20:40:58Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde geleert.&lt;/p&gt;
&lt;a href=&quot;https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;amp;diff=1989&amp;amp;oldid=1980&quot;&gt;Änderungen zeigen&lt;/a&gt;</summary>
		<author><name>Mgrifka</name></author>
	</entry>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;diff=1980&amp;oldid=prev</id>
		<title>Mgrifka am 2. September 2015 um 20:33 Uhr</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;diff=1980&amp;oldid=prev"/>
		<updated>2015-09-02T20:33:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 2. September 2015, 20:33 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Zeile 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Schnittstellenbeschreibung (Zentralabitur) =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Schnittstellenbeschreibung (Zentralabitur) =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ÄNDERN!!!&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Medium:Queue-Schnittstelle-Zentralabitur-2012.pdf|Queue Schnittstellenbeschreibung (PDF)]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Medium:Queue-Schnittstelle-Zentralabitur-2012.pdf|Queue Schnittstellenbeschreibung (PDF)]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mgrifka</name></author>
	</entry>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;diff=1973&amp;oldid=prev</id>
		<title>Mgrifka: Die Seite wurde neu angelegt: „Kategorie:Informatik Kategorie:Informatik-Q1 Kategorie:Informatik-Abitur Kategorie:Datenstrukturen(IF) = Funktionsweise = Die Datenstruktur Sch…“</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Queue_neu&amp;diff=1973&amp;oldid=prev"/>
		<updated>2015-09-02T17:32:06Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „&lt;a href=&quot;/wiki/index.php?title=Kategorie:Informatik&quot; title=&quot;Kategorie:Informatik&quot;&gt;Kategorie:Informatik&lt;/a&gt; &lt;a href=&quot;/wiki/index.php?title=Kategorie:Informatik-Q1&quot; title=&quot;Kategorie:Informatik-Q1&quot;&gt;Kategorie:Informatik-Q1&lt;/a&gt; &lt;a href=&quot;/wiki/index.php?title=Kategorie:Informatik-Abitur&quot; title=&quot;Kategorie:Informatik-Abitur&quot;&gt;Kategorie:Informatik-Abitur&lt;/a&gt; &lt;a href=&quot;/wiki/index.php?title=Kategorie:Datenstrukturen(IF)&quot; title=&quot;Kategorie:Datenstrukturen(IF)&quot;&gt;Kategorie:Datenstrukturen(IF)&lt;/a&gt; = Funktionsweise = Die Datenstruktur Sch…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Kategorie:Informatik]]&lt;br /&gt;
[[Kategorie:Informatik-Q1]]&lt;br /&gt;
[[Kategorie:Informatik-Abitur]]&lt;br /&gt;
[[Kategorie:Datenstrukturen(IF)]]&lt;br /&gt;
= Funktionsweise =&lt;br /&gt;
Die Datenstruktur Schlange (engl. queue) entspricht einer Warteschlange mit höflichen Menschen: Jeder Neuankömmling stellt sich hinten an und wartet geduldig, bis er ganz vorne steht und an der Reihe ist. Wer also zuerst kommt, ist auch zuerst dran. Entsprechend spricht man bei Schlangen in Anlehnung an die englische Kurzform first in, first out vom FIFO-Prinzip.&lt;br /&gt;
&lt;br /&gt;
= Schnittstellenbeschreibung (Zentralabitur) =&lt;br /&gt;
[[Medium:Queue-Schnittstelle-Zentralabitur-2012.pdf|Queue Schnittstellenbeschreibung (PDF)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Konstruktor	'''Queue&amp;lt;ContentType&amp;gt;()''' &lt;br /&gt;
&lt;br /&gt;
Nachher		Eine leere Schlange ist erzeugt. Nur Objekte vom Typ ContentType können eingefügt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anfrage		'''isEmpty(): boolean'''&lt;br /&gt;
&lt;br /&gt;
Nachher:		Die Anfrage liefert den Wert true, wenn die Schlange keine Elemente&lt;br /&gt;
		enthält, sonst liefert sie den Wert false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Auftrag		'''enqueue (ContentType pContent)'''&lt;br /&gt;
&lt;br /&gt;
Vorher:		Die Schlange ist erzeugt.&lt;br /&gt;
&lt;br /&gt;
Nachher:		pContent ist als letztes Element an die Schlange gehängt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Auftrag		'''dequeue()'''&lt;br /&gt;
&lt;br /&gt;
Vorher:		Die Schlange ist nicht leer.&lt;br /&gt;
&lt;br /&gt;
Nachher:		Das vorderste Element ist aus der Schlange entfernt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anfrage		'''front(): ContentType'''&lt;br /&gt;
&lt;br /&gt;
Vorher:		Die Schlange ist nicht leer.&lt;br /&gt;
&lt;br /&gt;
Nachher:		Die Anfrage liefert das vorderste Element der Schlange. Die Schlange ist unverändert.&lt;br /&gt;
&lt;br /&gt;
= Objektdiagramm eines Queue =&lt;br /&gt;
[[Datei:QueueNodes.png]]&lt;br /&gt;
TODO: Objektdiagramm erläutern&lt;br /&gt;
&lt;br /&gt;
= Veranschaulichung: Warteschlange =&lt;br /&gt;
Die Queue funktioniert wie eine Warteschlange an einer (englischen!!) Bushaltestelle: Man kann sich hinten anstellen und vorne wieder eine Person entnehmen.&lt;br /&gt;
&lt;br /&gt;
====Veranschaulichung: enqueue(ContentType pContent)====&lt;br /&gt;
[[Datei:Enqueue_Java.gif|border]]&lt;br /&gt;
&lt;br /&gt;
====Erläuterung: dequeue()====&lt;br /&gt;
[[Datei:DequeueJava.gif|border]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Implementationsdiagramm =&lt;br /&gt;
[[File:Implementationsdiagramm-Queue.png|thumb|Implementationsdiagramm Queue |628px]]&lt;br /&gt;
* Die Queue ''hat'' zwei [[Node|Nodes]]: &amp;lt;code&amp;gt;front&amp;lt;/code&amp;gt; und &amp;lt;code&amp;gt;last&amp;lt;/code&amp;gt;&lt;br /&gt;
* Jeder der Nodes hat einen &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;; darin wird der eigentliche Inhalt gespeichert (z.B. ein Objekt vom Typ &amp;lt;code&amp;gt;Person&amp;lt;/code&amp;gt; oder ein &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Außerdem hat jeder [[Node]] einen Verweis &amp;lt;code&amp;gt;next&amp;lt;/code&amp;gt; auf den Nachfolgerknoten.&lt;br /&gt;
&lt;br /&gt;
= Implementierung =&lt;br /&gt;
Für die Implementierung wird die Klasse [[Node]] verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 public class Queue&amp;lt;ContentType&amp;gt;{&lt;br /&gt;
    private Node&amp;lt;ContentType&amp;gt; frontNode;&lt;br /&gt;
    private Node&amp;lt;ContentType&amp;gt; lastNode;&lt;br /&gt;
  &lt;br /&gt;
    public Queue&amp;lt;ContentType&amp;gt;(){&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public boolean isEmpty(){&lt;br /&gt;
        return (frontNode == null);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public ContentType front(){&lt;br /&gt;
        return frontNode.getValue();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public void enqueue(ContentType pObject){&lt;br /&gt;
        Node&amp;lt;ContentType&amp;gt; newNode = new Node&amp;lt;ContentType&amp;gt;(pObject);&lt;br /&gt;
        if(frontNode == null){&lt;br /&gt;
            frontNode = newNode;&lt;br /&gt;
            lastNode = newNode;&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            lastNode.setNext(newNode);&lt;br /&gt;
            lastNode = newNode;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public void dequeue(){&lt;br /&gt;
        frontNode = frontNode.getNext();&lt;br /&gt;
        if(frontNode == null){&lt;br /&gt;
            lastNode = null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Verwendung von Queues =&lt;br /&gt;
[[Datei:Klassendiagramm_Buch.png|405px|thumb|right|Klassendiagramm der Klasse Buch]]&lt;br /&gt;
&lt;br /&gt;
Die Verwendung von Queues wird hier aufgezeigt für Queues, die Objekte vom Typ Buch enthalten (vgl. Klassendiagramm rechts)&lt;br /&gt;
&lt;br /&gt;
== Methode anzahl ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 public int anzahl(Queue&amp;lt;Buch&amp;gt; pQueue) {&lt;br /&gt;
    int ergebnis = 0;&lt;br /&gt;
    Queue&amp;lt;Buch&amp;gt; hilfs = new Queue&amp;lt;Buch&amp;gt;();&lt;br /&gt;
    while (!pQueue.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = pQueue.front();&lt;br /&gt;
       hilfs.enqueue(vorderstesBuch);&lt;br /&gt;
       pQueue.dequeue();&lt;br /&gt;
       ergebnis++;&lt;br /&gt;
    }&lt;br /&gt;
    while (!hilfs.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = hilfs.front();&lt;br /&gt;
       pQueue.enqueue(vorderstesBuch);&lt;br /&gt;
       hilfs.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    return ergebnis;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methode enthaelt==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 public boolean enthaelt(Queue&amp;lt;Buch&amp;gt; pQueue, String pTitel) {&lt;br /&gt;
    boolean ergebnis = false;&lt;br /&gt;
    Queue&amp;lt;Buch&amp;gt; hilfs = new Queue&amp;lt;Buch&amp;gt;();&lt;br /&gt;
    while (!pQueue.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = pQueue.front();&lt;br /&gt;
       if (vorderstesBuch.getTitel().equals(pTitel)) {&lt;br /&gt;
          ergebnis = true;&lt;br /&gt;
       }&lt;br /&gt;
       hilfs.enqueue(vorderstesBuch);&lt;br /&gt;
       pQueue.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    while (!hilfs.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = hilfs.front();&lt;br /&gt;
       pQueue.enqueue(vorderstesBuch);&lt;br /&gt;
       hilfs.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    return ergebnis;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methode loeschen ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 public void loeschen(Queue&amp;lt;Buch&amp;gt; pQueue, String pTitel) {&lt;br /&gt;
    Queue&amp;lt;Buch&amp;gt; hilfs = new Queue&amp;lt;Buch&amp;gt;();&lt;br /&gt;
    while (!pQueue.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = pQueue.front();&lt;br /&gt;
       if (!vorderstesBuch.getTitel().equals(pTitel)) {&lt;br /&gt;
          hilfs.enqueue(vorderstesBuch);&lt;br /&gt;
       }&lt;br /&gt;
       pQueue.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    while (!hilfs.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = pQueue.front();         &lt;br /&gt;
       pQueue.enqueue(vorderstesBuch);&lt;br /&gt;
       hilfs.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methode alphabetischErstes ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 private Buch alphabetischErstes(Queue&amp;lt;Buch&amp;gt; pQueue) {&lt;br /&gt;
    Queue&amp;lt;Buch&amp;gt; hilfs = new Queue&amp;lt;Buch&amp;gt;();&lt;br /&gt;
    Buch aktErstesBuch = pQueue.front();&lt;br /&gt;
    while (!pQueue.isEmpty()) {&lt;br /&gt;
       String vorderstesBuch = pQueue.front();&lt;br /&gt;
       // wenn der Titel von vorderstesBuch im Alphabet VOR dem titel von ergebnis steht, ...&lt;br /&gt;
       if (vorderstesBuch.getTitel().compareTo(aktErstesBuch.getTitel()) &amp;lt; 0) {&lt;br /&gt;
          // ... dann ergebnis updaten&lt;br /&gt;
          aktErstesBuch = vorderstesBuch;&lt;br /&gt;
       }&lt;br /&gt;
       hilfs.enqueue(vorderstesBuch);&lt;br /&gt;
       pQueue.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    while (!hilfs.isEmpty()) {&lt;br /&gt;
       Buch vorderstesBuch = hilfs.front();&lt;br /&gt;
       pQueue.enqueue(vorderstesBuch);&lt;br /&gt;
       hilfs.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    return ergebnis;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methode alphabetischRichtigEinfuegen ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  // '''Die Methode setzt voraus, dass pQueue schon alphabetisch sortiert und mit Strings gefüllt ist.''' &lt;br /&gt;
  private void alphabetischRichtigEinfuegen(Queue&amp;lt;String&amp;gt; pQueue, String pString) {&lt;br /&gt;
    Queue&amp;lt;String&amp;gt; hilfs = new Queue&amp;lt;String&amp;gt;();&lt;br /&gt;
    boolean eingefuegt = false;&lt;br /&gt;
    while (!pQueue.isEmpty()) {&lt;br /&gt;
       String vorderstes = pQueue.front();&lt;br /&gt;
       if (vorderstes.compareTo(pString) &amp;gt; 0 &amp;amp;&amp;amp; eingefuegt == false) {&lt;br /&gt;
          hilfs.enqueue(pString);&lt;br /&gt;
          eingefuegt = true;&lt;br /&gt;
       }&lt;br /&gt;
       hilfs.enqueue(vorderstes);&lt;br /&gt;
       pQueue.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
    while (!hilfs.isEmpty()) {&lt;br /&gt;
       pQueue.enqueue(hilfs.front());&lt;br /&gt;
       hilfs.dequeue();&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mgrifka</name></author>
	</entry>
</feed>