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
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
import logging | |
import pickle | |
import uuid |
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
var BinarySearchTree = function (value) { | |
var obj = Object.create(BinarySearchTree.prototype); | |
obj.value = value; | |
obj.left = null; | |
obj.right = null; | |
return obj; | |
}; | |
BinarySearchTree.prototype.insert = function (value) { | |
//if this is the first node, add it as root 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
var BinarySearchTree = function (value) { | |
var obj = Object.create(BinarySearchTree.prototype); | |
obj.value = value; | |
obj.left = null; | |
obj.right = null; | |
obj.parent = null; | |
return obj; | |
}; | |
BinarySearchTree.prototype.insert = function (value) { |