Buborékrendezés (Bubble sort)

Animáció

Struktogram

$BubbleSort(A:T[n])$

$i := n-1 \space downto \space 1$
$j := 0 \space to \space i-1$

$A[j] > A[j+1]$

$swap(A[j], A[j+1])$ $\text{SKIP}$

Feladatok