BogoSort

by Ricardo Fernández Serrata

Version 1 (April 25, 2021)

Download (1 downloads)

The infamous, inefficient sorting algorithm, ported to AM. The runtime is halved (optimized) because it checks whether the list is sorted in ascending or descending order.

This means there is 50% probability of the output being in either ascending or descending order. So the average runtime is O((n+1)! / 2). Best and worst cases are the same as stated in Wikipedia.

"Variable set out to inp" is used only because if the flow was running for a long time, it will remind you the original input.

en.wikipedia.org/wiki/Bogosort

3.0 average rating from 1 reviews

5 stars
0
4 stars
0
3 stars
1
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.