Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

What sorting algorithm is this?

$
0
0
The algorithm iterates over the collection once, storing the highest value and the lowest value. Then it makes an array with a size that is the range from the lowest number to the highest. The last step is to iterate over the array again and assign each value to it's index.

It only executes twice to sort any array but it scales nightmarishly with large ranges (it would make an array of length 1 million to sort the values 1 and 1 million), and it doesn't handle duplicates. It won't crash if...

What sorting algorithm is this?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>