Skip to content

Simplify is_bst.py #10627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update is_bst.py
  • Loading branch information
cclauss authored Oct 17, 2023
commit ded2c3b5df5d13c6757ae3dd1020d2b75fdac55e
1 change: 1 addition & 0 deletions data_structures/binary_tree/is_bst.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def is_sorted(self) -> bool:
doctest.testmod()
tree = Node(data=2.1, left=Node(data=2.0), right=Node(data=2.2))
print(f"Tree {list(tree)} is sorted: {tree.is_sorted = }.")
assert tree.right
tree.right.data = 2.0
print(f"Tree {list(tree)} is sorted: {tree.is_sorted = }.")
tree.right.data = 2.1
Expand Down