Map

What is the cost of getting Keys or Values from a Map?

Constant. It is because, Map (AbstractMap) keeps SET of Keys and Collection of Values.