Bogo Sort

Two implementations are provided:

  • Pseudo code, and
  • A array-based implementation.

When compiled with the -O2 option, the array-based implementation sorts an array of size twelve in 81 seconds; almost six times slower than bozo sort.

Pseudo Code

To bogo sort an array:
	While the array is unsorted,
		Randomly order the entries.
	end
end

Array-based Implementation

A straight-forward implementation of the pseudo code.