Stooge sort

Stooge sort is an impractical sorting algorithm with a time complexity of $$O(n^{\log_{1.5}3})$$. It is not stable and not adaptive. It also requires $$O(n)$$ stack memory.

=Explanation= To stoogesort an array, check if the first and last elements are out of order. if yes, swap them. If there are more than two elements, then stoogesort the first 2/3 of the array (rounded UP), stooge sort the second 2/3 of the array, then stoogesort the first 2/3 of the array again.

= Pseudocode = procedure stooge_sort(array arr,int i,int j) do if arr[j] < arr[i] do swap arr[i] and arr[j] end if if j - i + 1 > 2 do int s = floor((j - i + 1) / 3) stooge_sort(arr,i,j - s)        stooge_sort(arr,i + s,j) stooge_sort(arr,i,j - s)   end if end