export default class Node { public key: Key; public data: Value; public left: Node | null = null; public right: Node | null = null; public next: Node | null = null; constructor(key: Key, data?: Value) { this.key = key; // insert(key) without data leaves it undefined, as before this.data = data as Value; } }