de.hska.info1.sortieren
Class Bubblesort

java.lang.Object
  extended by de.hska.info1.sortieren.Bubblesort
All Implemented Interfaces:
Sortieren

public class Bubblesort
extends java.lang.Object
implements Sortieren

Enthält Implementierungsvarianten von Bubblesort.

Author:
pape

Constructor Summary
Bubblesort()
           
 
Method Summary
 void sortieren(int[] a)
          Sortiert mit verbesserter Variante von Bubblesort.
 void sortieren1(int[] a)
          Sortiert mit Bubblesort.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bubblesort

public Bubblesort()
Method Detail

sortieren1

public void sortieren1(int[] a)
Sortiert mit Bubblesort. Hat O(n*n) Zeitaufwand in jedem Fall.


sortieren

public void sortieren(int[] a)
Sortiert mit verbesserter Variante von Bubblesort. Hat O(n*n) Zeitaufwand im schlechtesten und mittleren Fall, jedoch O(n) im besten Fall (bei fast aufsteigend sortierten Felder).

Specified by:
sortieren in interface Sortieren


Prof. Dr. Pape