We know we can use
Collections.sort
to sort a list after all elements inserted.
But if elements are inserted once a time, maybe the SortedMap
is more effective?
Though, the SortedMap
lack the subList
method.
What I need is something like SortedMap
can effectively insert small amount of elements many times, and can always get a 1~1000 sublist top-down with a Comparator
interface.
Any Suggestion?