I have the following simple class, containing a String and an Int.
private static class SuggestionAndScore
{
private String suggestion;
private int score;
}
I will have a List of these objects which may contain up on 500,000 items. What is the best way to sort this based on the value of score? Should I have the class implement Comparator and use Collections.sort on it or it there a better way? Performance is critical so hence my question as I want to make sure I get the best solution.
Collections.sort()and if it isn't good enough, then you can start think about better alternatives.int.