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):
194
194
node_color = node_min .color
195
195
temp_node = node_min .right
196
196
##
197
- if node_min .parent != node :
197
+ if node_min .parent is not node :
198
198
self .transplant (node_min , node_min .right )
199
199
node_min .right = node .right
200
200
node_min .right .parent = node_min
@@ -208,9 +208,9 @@ def delete(self, node):
208
208
209
209
def delete_fixup (self , node ):
210
210
# 4 cases
211
- while node != self .root and node .color == 0 :
211
+ while node is not self .root and node .color == 0 :
212
212
# node is not root and color is black
213
- if node == node .parent .left :
213
+ if node is node .parent .left :
214
214
# node is left node
215
215
node_brother = node .parent .right
216
216
You can’t perform that action at this time.
0 commit comments