-
Notifications
You must be signed in to change notification settings - Fork 5
Description
1. Remove
REMOVE keyDescription:
This operation removes the key-value pair associated with the given key from the hash map. If the key does not exist in the hash map, the operation may return an error.
Time Complexity: O(N) where N is the length of the map. Setting either the first or the last element of the map is O(1).
2. Get
GET keyDescription:
This operation retrieves the value associated with the given key from the hash map. If the key does not exist, it may return a default value, null, or an error.
Time Complexity: O(N) where N is the length of the map. Setting either the first or the last element of the map is O(1).
3. Contains
CONTAINS keyDescription:
This operation checks whether the given key exists in the hash map. It returns a boolean value indicating the presence or absence of the key.
Time Complexity: O(N) where N is the length of the map. Setting either the first or the last element of the map is O(1).
4. Put
PUT key valueDescription:
This operation inserts the value associated with the given key in the hash map.
Time Complexity: O(N) where N is the length of the map. Setting either the first or the last element of the map is O(1).