'Laziest' Stable Sort

preview_player
Показать описание
In-place stable sort that can achieve O(n^(3/2)) worst case.

Рекомендации по теме
Комментарии
Автор

But what happens when this algorithm stops being lazy



Top 10 questions scientists can't answer to this day

charlieferme
Автор

I tried to make a sort alghoritm with the least amount of lines. Someone probably thought of this before me idk.
It is also extremely slow

function lazySort(array A, int start, int end)
if end - start < 1
return A
if A[start] > A[end]
swap(A[start], A[end])
A = lazySort(A, start, end - 1)
return lazySort(A, start + 1, end)

Matyanson
Автор

What is this sort most similar to? (the well known ones)

Matyanson