bogo-sort

bogo-sort

(algorithm, humour)/boh"goh-sort"/ (Or "stupid-sort") Thearchetypical perversely awful algorithm (as opposed tobubble sort, which is merely the generic *bad* algorithm).Bogo-sort is equivalent to repeatedly throwing a deck of cardsin the air, picking them up at random, and then testingwhether they are in order. It serves as a sort of canonicalexample of awfulness. Looking at a program and seeing a dumbalgorithm, one might say "Oh, I see, this program usesbogo-sort."

Also known as "monkey sort" after the Infinite Monkey Theorem.

Compare brute force, Lasherism.

An implementation.