mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
24 lines
464 B
Python
24 lines
464 B
Python
from nose.tools import assert_equal
|
|
|
|
|
|
class TestBstMin(object):
|
|
|
|
def test_bst_min(self):
|
|
array = [0, 1, 2, 3, 4, 5, 6]
|
|
root = create_min_bst(array)
|
|
assert_equal(height(root), 3)
|
|
|
|
array = [0, 1, 2, 3, 4, 5, 6, 7]
|
|
root = create_min_bst(array)
|
|
assert_equal(height(root), 4)
|
|
|
|
print('Success: test_bst_min')
|
|
|
|
|
|
def main():
|
|
test = TestBstMin()
|
|
test.test_bst_min()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main() |