For the purposes of this exercise, the only data structures that need to be considered are: array, ArrayList, LinkedList, HashSet, TreeSet, HashMap, and TreeMap. For passing over the elements of a data structure, consider only Iterator and for loop.
Situation: You need to write a function that, given a state abbreviation code (a String), returns the capital city of that state (a String). You may assume there are exactly 50 state codes.
Question: What data structure would be appropriate, and how could this data structure be used? Show the following:
m_stateCapitals, declaration and constructor call.
private String capital(String stateCode), that returns the capital city associated with the corresponding state code..