AlgorandSIMULATION v1.0
Sequential Engines(17)
Parallel Engines
Bubble Sort
sequentialRAMA simple comparison-based sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
SIMULATION STEP PROGRESSStep 1 / 1
SPEED (50%)
SIZE (8)
💡 Tip: Enter integers between 1 and 99. Max size is 15.
Code Workspace
1procedure bubbleSort(A: list of sortable items)
2 n := length(A)
3 repeat
4 swapped := false
5 for i := 1 to n-1 inclusive do
6 if A[i-1] > A[i] then
7 swap(A[i-1], A[i])
8 swapped := true
9 end if
10 end for
11 n := n - 1
12 until not swapped
13end procedure
Currently highlights executing branch
RUNTIME COST METRICS
Comparisons0
Memory Writes0
Memory Reads0
Elements Swapped0
Computational Model:RAM (Single Core)
Theoretical Bound:O(N²)
Space Complexity:O(1)
Communication Cost:0 (Shared Bus)
THEORETICAL ANALYSIS & RESEARCH
Conceptual Focus: A simple comparison-based sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
Real-world Industrial Applications:
- Education and academic demonstrations
- Detecting already-sorted or nearly-sorted arrays efficiently