mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
convert property 'is_right' to one-liner
Also use 'is' instead of '==' Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
parent
2791958f9a
commit
ba2efa2181
@ -79,9 +79,7 @@ class Node:
|
||||
|
||||
@property
|
||||
def is_right(self) -> bool:
|
||||
if self.parent and self.parent.right:
|
||||
return self == self.parent.right
|
||||
return False
|
||||
return self.parent and self is self.parent.right
|
||||
|
||||
|
||||
class BinarySearchTree:
|
||||
|
Loading…
x
Reference in New Issue
Block a user