typescript-ds-lib
Version:
A collection of TypeScript data structure implementations
18 lines (17 loc) • 549 B
TypeScript
import { Comparator } from '../types';
import { BaseCollection } from './base-collection';
export interface Map<K, V> {
insert(key: K, value: V): void;
find(key: K): V | undefined;
delete(key: K): void;
remove(key: K): void;
forEach(callback: (key: K, value: V) => void): void;
}
export declare class Map<K, V> extends BaseCollection<V> implements Map<K, V> {
private rbTree;
constructor(comparator?: Comparator<K>);
clear(): void;
size(): number;
isEmpty(): boolean;
equals(other: Map<K, V>): boolean;
}