Ready to sort

Statistics

Status Idle
Operations 0 / 0

Controls

50
5x

Summary

Bogo Sort, also known as Permutation Sort or Stupid Sort, is a sorting algorithm based on the generate and test paradigm. It is not used for practical sorting but serves as an excellent educational tool to illustrate the concept of a "perverse" or brute-force algorithm. The strategy is simple: if the list is not sorted, shuffle it randomly and check again. This continues until the single correct permutation is found by pure chance.

How it Works

  • 1. Check Order: Iterate through the list to check if it is sorted. If it is, the algorithm is complete.

  • 2. Shuffle: If the list is not sorted, randomly shuffle all of its elements to create a new, random permutation.

  • 3. Repeat: Go back to step 1 and repeat the process indefinitely until the sorted permutation is generated.