Home/Blog/Exams & Theory

Sorting Algorithms in Structograms: Bubble Sort Step by Step

2026-11-227 min read

1. How Bubble Sort Works

Bubble Sort repeatedly steps through the array, compares adjacent elements, and swaps them using a temporary variable if they are in the wrong order.

Live Example (DIN 66261)

Rendered directly in DIN 66261 — click to open and edit in the workspace.

bubbleSort(arr)temp = arr[j]arr[j] = arr[j + 1]arr[j + 1] = temparr[j] > arr[j + 1]wahrfalschj = 0 bis laenge(arr) - 2 - ii = 0 bis laenge(arr) - 2

More Articles