From ced86db4658bdc3aba7e3f59991c1723ceae0531 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Wed, 12 Jun 2019 10:55:58 -0500 Subject: Binary Search Tree check done! Easy after Java version is done. I'm happy that I did this in 3 languages (Java, Python, C++). I can really tell that Python is more succinct, whereas Java is really verbose. Fun stuff :) --- tests/tree_bst_checkTest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/tree_bst_checkTest.py (limited to 'tests') diff --git a/tests/tree_bst_checkTest.py b/tests/tree_bst_checkTest.py new file mode 100644 index 0000000..6924168 --- /dev/null +++ b/tests/tree_bst_checkTest.py @@ -0,0 +1,15 @@ +import unittest + +from sources.tree_bst_check import isBst + +class MyTestCase(unittest.TestCase): + def test_something(self): + key = [2, 1, 3] + left = [1, -1, -1] + right = [2, -1, -1] + + self.assertTrue(isBst(key, left, right)) + + +if __name__ == '__main__': + unittest.main() -- cgit v1.2.3