> How often do you need to sort an array of numbers? In practice you almost always want to sort an array of objects based on one of their properties.
And? If your objects are immovable then one level of indirection (pointers or indices) solves that. If your objects are moveable, then there's many (!) times where having your container sorted will improve performance.
I don't see how you can add that level of indirection if you can only sort an array of numbers.
Let's say you have a Person object with property 'age' which is an Int.
I can put the Person's ages into an Int Array and sort that. Where to add this indirection to get to the sorted array of Person objects?
Eh yes, this works, but you are not using Arrays.intSort here. Which means that the optimizations that the article is about won't apply.
intSort (or any other of the sorts in the article) works purely on an Array of Ints, moving them around and comparing them to each other.
It's quite hard to come up with something that we could use in every day programming that will benefit from the new optimizations.
And? If your objects are immovable then one level of indirection (pointers or indices) solves that. If your objects are moveable, then there's many (!) times where having your container sorted will improve performance.