bubbleSort(int[] array) { #header
  Deklariere Variablen i, j;  #variables
  Setze tauschungErfolgt = true; #initSwap
  Starte bei i = array.length bis i==0 oder tauschungErfolgt == false #outerLoop
    Setze swapPerformed = false; #resetSwap
    Starte bei j = 1 bis j == i #innerLoop
      Falls Element an Position j - 1 > Element an Position j #if
        Vertausche Feldpositionen j-1 und  j #swap
        Setze tauschungErfolgt = true; #swap=true
      } #endif
    } #endInnerLoop
  } #endOuterLoop
} #end