Polish bst successor challenge and solution (#82)

Update constraints, test cases, tests, algorithm discussion, and code.
This commit is contained in:
Donne Martin
2016-06-25 22:06:35 -04:00
committed by GitHub
parent 042161dc3b
commit 7b573ceaa3
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 TestBstSuccessor(object):
@raises(Exception)
def test_bst_successor_empty(self):
bst_successor(None)
def test_bst_successor(self):
nodes = {}
node = Node(5)
@@ -30,6 +35,7 @@ class TestBstSuccessor(object):
def main():
test = TestBstSuccessor()
test.test_bst_successor()
test.test_bst_successor_empty()
if __name__ == '__main__':