File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
algorithms/tree/red_black_tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ def delete(self, node):
194194 node_color = node_min .color
195195 temp_node = node_min .right
196196 ##
197- if node_min .parent != node :
197+ if node_min .parent is not node :
198198 self .transplant (node_min , node_min .right )
199199 node_min .right = node .right
200200 node_min .right .parent = node_min
@@ -208,9 +208,9 @@ def delete(self, node):
208208
209209 def delete_fixup (self , node ):
210210 # 4 cases
211- while node != self .root and node .color == 0 :
211+ while node is not self .root and node .color == 0 :
212212 # node is not root and color is black
213- if node == node .parent .left :
213+ if node is node .parent .left :
214214 # node is left node
215215 node_brother = node .parent .right
216216
You can’t perform that action at this time.
0 commit comments