Skip to content

Instantly share code, notes, and snippets.

@boxgames1
Created June 29, 2018 10:56
Show Gist options
  • Save boxgames1/f099b1eb75878b8f96db8d2bef0dc6d8 to your computer and use it in GitHub Desktop.
Save boxgames1/f099b1eb75878b8f96db8d2bef0dc6d8 to your computer and use it in GitHub Desktop.
Binary Node
class BinaryNode {
constructor(key, value) {
this.value = value;
this.key = key;
this.left = null;
this.right = null;
}
// Cost: O(1)
free() {
this.left = null;
this.right = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment