Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def delete(self, val):
elif self.left is None:
return self.right
elif self.right is None:
return self.right
# return self.right
return self.left # because we don't want to loose the left subtree, suppose [2, 4, 3] where 2 is root and we removed 4

max_val = self.left.find_max()
self.data = max_val
Expand Down