Skip to content
/ Hashsort Public

A linear(ish) time sorting algorithm for integers

Notifications You must be signed in to change notification settings

vaiso/Hashsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Hashsort

A linear(ish) time sorting algorithm. The actual time complexity is O(n + d), where d is the difference between the largest and smallest elements of the array. This makes it very easy to construct an adversarial input (e.g. [-1000000,10000000], but for inputs where d is not significantly larger than n, it performs quite well.

Note: due to using the array values themselves as indexes, hashsort ONLY works for arrays of integers. This means its real-world applications are fairly limited, but it was a fun thought experiment for me.

About

A linear(ish) time sorting algorithm for integers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages