Update data_structures/binary_tree/binary_search_tree.py

This commit is contained in:
Tianyi Zheng 2023-08-15 16:00:34 -07:00 committed by GitHub
parent 38aca4daca
commit 8212690198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,8 +78,8 @@ class Node:
return pformat({f"{self.value}": (self.left, self.right)}, indent=1) return pformat({f"{self.value}": (self.left, self.right)}, indent=1)
@property @property
def is_right(self): def is_right(self) -> bool:
return self.parent and self is self.parent.right return self.parent is not None and self is self.parent.right
class BinarySearchTree: class BinarySearchTree: