mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-03-04 14:48:45 +00:00
Added min height bst challenge.
This commit is contained in:
24
graphs_trees/bst_min/test_bst_min.py
Normal file
24
graphs_trees/bst_min/test_bst_min.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user