diff --git a/data_structures/Binary Tree/binary_seach_tree.py b/data_structures/Binary Tree/binary_seach_tree.py index 1f14514b5..1dac948ae 100644 --- a/data_structures/Binary Tree/binary_seach_tree.py +++ b/data_structures/Binary Tree/binary_seach_tree.py @@ -1,6 +1,8 @@ ''' A binary search Tree ''' + + class Node: def __init__(self, label): @@ -34,7 +36,7 @@ class BinarySearchTree: def insert(self, label): - #Create a new Node + # Create a new Node node = Node(label) @@ -45,7 +47,7 @@ class BinarySearchTree: curr_node = self.root while True: - if curr_node != None: + if curr_node is not None: dad_node = curr_node @@ -61,12 +63,12 @@ class BinarySearchTree: break def empty(self): - if self.root == None: + if self.root is None: return True return False def preShow(self, curr_node): - if curr_node != None: + if curr_node is None: print(curr_node.getLabel(), end=" ") self.preShow(curr_node.getLeft())