We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I propose addition of a new sorting algorithm which combines the best features of both stalinsort and bogosort.
The algorithm is fairly simple: Just randomly remove elements until the array is in order.
Complexity ranges from O(n) to O(n²)
O(n)
O(n²)
Hope this will make the world a better place!
The text was updated successfully, but these errors were encountered:
Alternatively:
i,j ∈ [0; n[; i < j
L[i] <= L[j]
2
L[i] > L[j]
L[j]
1
Best-case complexity is O(n), worst-case is O(n³) (n² random picks per iteration, n iterations, step 1 is dwarved by steps 2 and 3).
O(n³)
Sorry, something went wrong.
No branches or pull requests
I propose addition of a new sorting algorithm which combines the best features of both stalinsort and bogosort.
The algorithm is fairly simple:
Just randomly remove elements until the array is in order.
Complexity ranges from
O(n)
toO(n²)
Hope this will make the world a better place!
The text was updated successfully, but these errors were encountered: