Sort My Numbers
Write a program to sort the given numbers in any order (ascending/descending). The given set of numbers have following properties:
- All are positive integers between range (0 to 65535).
- There are no duplicates i.e., every number appears maximum once.
Note that using pre-defined alogrithms (insertion sort, bubble sort, binary sort, ...) won't optimize for given conditions. So present a solution that is optimized for both memory and CPU (ideally operate in constant time) for the given conditions.
Expected Output:
- Code
- Set of testcases (sample number sets)
Solution:
➜ git clone https://github.com/yasin-cs-ko-ak/sort-my-numbers.git
➜ cd sort-my-numbers
➜ go run sort-my-numbers.go 0-65535.txt >> output.txt
See the output.txt for the output.