WOLFRAM|DEMONSTRATIONS PROJECT

Extended Bead-Sort

​
run
size
9
25
normal
extended
single
gap
clump
hardware
new
initial:
{1,4,0,7,0,0,8,6,0}
interim:
{1,4,0,7,0,0,8,6,0}
sorted:
{0,0,0,0,1,4,6,7,8}
Bead-Sort is a method of ordering a set of positive integers by mimicking the natural process of objects falling to the ground, as beads on an abacus slide down vertical rods. The number of beads on each horizontal row represents one of the numbers of the set to be sorted, and it is clear that the final state will represent the sorted set. In this Demonstration the sorting process can be run or stepped through, two sample sizes selected, and new random datasets generated. The "extended" (anti-gravity) mode allows the inclusion of all integers, with "negative beads" rising while "positive beads" fall.