This challenge is intended to be solved by sorting, ordering, or otherwise organizing some set of data.
A challenge with this tag must at least define some sort of well-ordering to allow programs to sort a list of data.
- Simple sorts:
- Efficient sorts:
- Bubble sort and variants:
- Bubble sort works by iterating through the list and comparing two adjacent values, swapping if they are out of order.
- Shell sort
- Comb sort works by eliminating "turtles" (ie out of order elements at the end of the list) before bubble-sorting.
- Distribution sort includes:
- Counting sort
- Radix sort
- Bogosort works by randomizing the list until it is in proper order. It is comparable to throwing a deck of cards in the air and collecting them together again until it is sorted. Bogosort has a number of related algorithms:
- Gorosort works by randomly permuting subsets of the list.
- Bogobogosort works by applying bogosort on the first two elements of the list, then the first three, and so on, but it starts over at the first two elements if the section of the list it randomized was not sorted.
- Stooge sort
- Pancake sort is sorting by flipping a stack of pancakes. A "spatula" is inserted anywhere in the stack and the stack of "pancakes" above that is flipped.