node.ts 335 B

123456789101112131415
  1. export default class Node<Key, Value> {
  2. public key:Key;
  3. public data:any;
  4. public left:Node<Key, Value>|null;
  5. public right:Node<Key, Value>|null;
  6. public next:Node<Key, Value>|null = null;
  7. constructor (key:Key, data?:any) {
  8. this.key = key;
  9. this.data = data;
  10. this.left = null;
  11. this.right = null;
  12. }
  13. }