I have two ArrayLists: a String list and an integer list. For example:
Bob 2
Kevin 6
Lane 4
Susan 2
//the ArrayLists will have more elements
I'm trying to sort the integer ArrayList (with MergeSort) and having the String ArrayList correspond to the integer ArrayList, such as:
Susan 2
Bob 2
Lane 4
Kevin 6
The other answers I've come upon advised on using a Map (the int being the key, the String being the value); however, I cannot do so because there would be duplicate keys.
I have read about Guava's Multimap; however, I'm not quite comfortable with including jar files to classpaths.
Is there any other way to do this?
ArrayList.