mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-03-04 14:48:45 +00:00
Polish bst validate challenge and solution (#83)
Update constraints, test cases, tests, algorithm discussion, and code.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user