I have an array of Pairs.
The first value in the Pair represents coefficient of a polynomial, and the second represents the power of the polynomial.
How can I sort it in a descending order without creating a long code?
Someone here recommended me to use Collections.sort() on the array of Pairs, but I don't understand how it's possible to do this on this array, since it doesn't represent a list, so it's impossible to sort it.
I obviously need to sort it by the powers value, but how it's possible to do this and change the coefficient's indices in accordance with the power parameter?
Thank you!