I am implementing a deletion of a node from a binary search tree in python. I got stuck in an edge case. Consider next code:
class Node():
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.right = right
root = Node(5)
root.right = Node(10)
How to implement a function that deletes the root. I do not want the function return new root. In C++ I can modify pointer to make root point to its child, however in python variables are labels essentially. Is it even possible to do in python?