Polish bst validate challenge and solution (#83)

Update constraints, test cases, tests, algorithm discussion, and code.
This commit is contained in:
Donne Martin
2016-06-25 22:08:54 -04:00
committed by GitHub
parent 7b573ceaa3
commit 589ff06b15
3 changed files with 46 additions and 15 deletions

View File

@@ -1,8 +1,13 @@
from nose.tools import assert_equal
from nose.tools import raises
class TestBstValidate(object):
@raises(Exception)
def test_bst_validate_empty(self):
validate_bst(None)
def test_bst_validate(self):
node = Node(5)
insert(node, 8)
@@ -26,6 +31,7 @@ class TestBstValidate(object):
def main():
test = TestBstValidate()
test.test_bst_validate_empty()
test.test_bst_validate()