Hash Map: is a data structure that provides a mapping from keys to value using a technique called hashing. Keys must be unique, but we can have duplicate values. In Java, Hash Map extends AbstactMap class that implements the Map interface. Map<Integer,String> map = new HashMap<>(); A Hash function H(x)…