Closed
Description
Repository commit
Python version (python --version)
Python 3.10.6
Dependencies version (pip freeze)
astroid==2.15.4
...
Expected behavior
Removing the root node should not delete the whole tree, it should behave just like removing any other nodes. It works fine if we delete other nodes but I guess because of the this line, it has problem when we remove the root node. There should be other checks as well.
Actual behavior
>>> t = BinarySearchTree()
>>> t.insert(1)
>>> t.insert(2)
>>> t.insert(3)
>>> t.remove(1)
>>> str(t)
'None'
>>>