@gabrielrufino/cube
Version:
Data structures made in Typescript
17 lines (16 loc) • 639 B
TypeScript
import type IHashTable from './IHashTable';
import type IHashTableData from './IHashTableData';
import type IHashTableInputs from './IHashTableInputs';
import type IHashTableOptions from './IHashTableOptions';
export default class HashTable<T = number> implements IHashTable<T> {
readonly maxSize: number;
private _data;
constructor(inputs?: Readonly<IHashTableInputs<T>>, { maxSize }?: IHashTableOptions);
get data(): IHashTableData<T>;
get size(): number;
put(key: string, value: T): T;
get(key: string): T | null;
remove(key: string): T | null;
private _hashCode;
private [Symbol.toPrimitive];
}