An open API service indexing awesome lists of open source software.

https://github.com/glesica/shotgun-sort

ANSI C Implementation of Shotgun Sort
https://github.com/glesica/shotgun-sort

c sorting sorting-algorithms stupid

Last synced: over 1 year ago
JSON representation

ANSI C Implementation of Shotgun Sort

Awesome Lists containing this project

README

          

An ANSI C implementation of Shotgun Sort. The general algorithm works as such:

SGSORT(list):
while list is not sorted:
randomize list

Note: This should be obvious, but in case it isn't, don't actually use this
algorithm for real work. It's time complexity is unbounded and it may never
terminate.

Note 2: I didn't think very hard about the randomize() function, it may
not produce orderings in a uniformly distributed manner. But really who
cares, as long as all orderings are possible.