UNPKG

typescript-algorithms-and-datastructures

Version:
25 lines (24 loc) 786 B
import { IHashTable } from "./Interfaces/IHashTable"; import { IKeyValuePair } from "./Interfaces/IKeyValuePair"; export declare class HashTable<K, V> implements IHashTable<K, V> { private capacity; private buckets; private hash; private equalKey; private equalValue; constructor(capacity: number, hash: (value: K) => number); clear(): void; clone(): IHashTable<K, V>; contains(value: V): boolean; containsKey(key: K): boolean; containsValue(value: V): boolean; elements(): IKeyValuePair<K, V>[]; get(key: K): V; put(key: K, value: V): void; putAll(elements: IKeyValuePair<K, V>[]): void; remove(key: K): V; size(): number; values(): V[]; private getBucket; } export default HashTable;