If you embed a hash map like so:
Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>();
Map<String, String> innerMap = new HashMap<String, String>();
innerMap.put("x","y");
map.put("z", innerMap);
innerMap = map.get("z"); <---------- O(1) time
String y = innerMap.get("x"); <-------- O(1) time
Does this mean that as long as both maps search times stay relatively close to O(1) then you can essentially search through a second level of a hashmap still in O(1) time?
My internship responsibilities have me dealing heavily with data comparisons and I used something similar to this the other day. I had a string key value that was the name of a certain "Plan" and a value as a hashmap. The internal hashmap had a string key value of an employee ID and a relationship(if an employee was visited twice meaning they had two different coverage levels within the plan from the external map, then their relationship would be updated. Was my choice of DS here a good one? I was attempting to achieve a lookup & edit time of O(1)