Last active
February 14, 2016 07:37
-
-
Save josiahcarlson/344475fbe5a13fafcf2f to your computer and use it in GitHub Desktop.
A new ordering on an array that offers faster searching than binary search, yet is just as simple. Allows for O(log(n)) modifications and searches. Paper and details forthcoming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gcc -O4 -o shuffle_search.out shuffle_search.c | |
$ ./shuffle_search.out | |
Generate 10000000 random input values... | |
Select 1000000 random items from the input and duplicating 10x times... | |
Random reorder selected items | |
Sorting input... qsort O(nlogn) | |
Shuffle transforming input... O(n) | |
Binary searching | |
3.932018 | |
3.933678 | |
3.930304 | |
3.914224 | |
3.913806 | |
3.913014 | |
3.914340 | |
3.913783 | |
3.911145 | |
3.910197 | |
Shuffle searching | |
2.360457 | |
2.359909 | |
2.360207 | |
2.360000 | |
2.360559 | |
2.359838 | |
2.359948 | |
2.360830 | |
2.360778 | |
2.360171 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment