Skip to content

Map operations #20

@xXenvy

Description

@xXenvy

1. Remove

REMOVE key

Description:
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 key

Description:
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 key

Description:
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 value

Description:
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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions