mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-16 22:38:02 +00:00
Polish bst successor challenge and solution (#82)
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 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__':
|
||||
|
||||
Reference in New Issue
Block a user