diff options
author | Haidong Ji | 2019-06-12 20:10:34 -0500 |
---|---|---|
committer | Haidong Ji | 2019-06-12 20:10:34 -0500 |
commit | 99caed4f61576f75bea5c824b89caf14997f7082 (patch) | |
tree | b302e1418a70acb5660bf8177dd694d1aca63db9 /sources | |
parent | ced86db4658bdc3aba7e3f59991c1723ceae0531 (diff) |
2 simple changes were all needed :)
Diffstat (limited to 'sources')
-rw-r--r-- | sources/tree_bst_check.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/tree_bst_check.py b/sources/tree_bst_check.py index 28af017..b646d4c 100644 --- a/sources/tree_bst_check.py +++ b/sources/tree_bst_check.py @@ -21,13 +21,13 @@ def isBst(key, left, right): else: i = keyIndexStack.pop() if len(result) > 0: - if key[i] <= result[-1]: + if key[i] < result[-1]: return False result.append(key[i]) walkLeft = False else: if right[currentIndex] != -1: - if key[right[currentIndex]] <= key[currentIndex]: + if key[right[currentIndex]] < key[currentIndex]: return False currentIndex = right[currentIndex] keyIndexStack.append(currentIndex) |