Created
June 29, 2018 10:56
-
-
Save boxgames1/f099b1eb75878b8f96db8d2bef0dc6d8 to your computer and use it in GitHub Desktop.
Binary Node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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