\Intro: The period of the algorithm is so slower compared to economical sorting algorithms, similar to Merge sort, and is even slower than Bubble sort, a canonical example of a reasonably inefficient and easy sort. 

Explanation:

The algorithm is defined as follows:

  • If the value at the end is smaller than the value at the start, swap them.
  • If there are 3 or more elements in the list, then:
    • Stooge sort the initial 2/3 of the list
    • Stooge sort the final 2/3 of the list
    • Stooge sort the initial 2/3 of the list again

Detailed:

function stoogesort(array L, i = 0, j = length(L)-1)
          if L[j] < L[i] then
                     L[i] ↔ L[j]
          if (j - i + 1) > 2 then
                      t = (j - i + 1) / 3
                      stoogesort(L, i , j-t)
                      stoogesort(L, i+t, j )
                      stoogesort(L, i , j-t)
                      return L