小于 1 分钟
Home > @hz-9/algorithm > Hashmap
Hashmap class
A base class for hash maps.
一个哈希表的基类。
Signature:
export declare abstract class Hashmap<K, V> extends Base<IKeyValueObj<K, V>>Extends: Base<IKeyValueObj<K, V>>
Methods
Method | Modifiers | Description |
|---|---|---|
| Retrieves the value from the hash map based on the key. 根据键从哈希表中获取值。 Time complexity: O(1) Space complexity: O(1) | |
| Checks if the hash map contains a value for the key. 判断在哈希表中是否有该键的值。 Time complexity: O(1) Space complexity: O(1) | |
| Removes the key from the hash map. 在哈希表中删除该键。 Time complexity: O(1) Space complexity: O(1) | |
| Adds a key-value pair to the hash map. 将键值对添加到哈希表中。 Time complexity: O(1) Space complexity: O(1) |