mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-24 05:21:09 +00:00
fix some style errors
This commit is contained in:
parent
a3972dd9b4
commit
817c27462b
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue
Block a user