AlgorandSIMULATION v1.0
Sequential Engines(17)
Parallel Engines

Odd-Even Transposition Sort

parallelRing

A parallel version of Bubble Sort running on a Ring or 1D array of processors. Alternates between odd-even and even-odd index comparisons, sorting the array in O(N) parallel steps.

SIMULATION STEP PROGRESSStep 1 / 1
SPEED (50%)
SIZE (8)
CORES (4)
💡 Tip: Enter integers between 1 and 99. Max size is 12.
Code Workspace
1procedure OddEvenSort(A: array of size N)
2 for phase := 0 to N-1 do
3 if phase is even (even-odd phase) then
4 for each processor P_i (i even, i < N-1) in parallel do
5 if A[i] > A[i+1] then swap(A[i], A[i+1])
6 end parallel-for
7 else (odd-even phase) then
8 for each processor P_i (i odd, i < N-1) in parallel do
9 if A[i] > A[i+1] then swap(A[i], A[i+1])
10 end parallel-for
11 end if
12 barrier()
13 end for
14end procedure
Currently highlights executing branch
RUNTIME COST METRICS
Comparisons0
Memory Writes0
Memory Reads0
Elements Swapped0
Core Capacity:4 Cores
Total Work Done:5 operations
Critical Path Span:2 levels
Observed Speedup:2.5x
Efficiency Bound:63%
PROCESSOR ALLOCATION EFFICIENCY
THEORETICAL ANALYSIS & RESEARCH

Conceptual Focus: A parallel version of Bubble Sort running on a Ring or 1D array of processors. Alternates between odd-even and even-odd index comparisons, sorting the array in O(N) parallel steps.

Real-world Industrial Applications:
  • Systolic arrays and linear processor pipelines
  • Teaching fundamental inter-processor communications