Bogo Sort is known as one of the worst sorting algorithms ever made. Bogo Sort works by randomly ordering each element and checking if it's in order.
Imagine you have a deck of cards. Bogo Sort first checks if the cards are in order. If the deck is in order, it stops. Otherwise it shuffles the entire deck and tries again. It continues to shuffle and check until the deck is fully organized.
The first step is to check if the list is organized. If the list is in order then the sorting is done, otherwise continue.
If the list is not sorted, randomize the order of the elements in the list.
Repeat this process until the list is in order.
Bogo sort cannot accurately measure the speed of the sorting, it ranges from the best case of O(n), where the list is already sorted, to the worst case of O(∞), where the list is never sorted.
Bogo Sort is highly inefficient and only used as a joke. Bogo Sort originally comes from "Bogus Sort".
Bogo Sort is commonly used as a teaching aid to compare and contrast more efficient algorithms.