Relative Content

Tag Archive for python-3.xdsa

Insert() method for a Red-Black Tree

I am trying to implement a Red-Black Tree with insert() method for a new node and if the node can either become the root node, left node of the root node or the right node of the root node. I keep running into error when i tried to run the code against my test code base.
AttributeError: ‘int’ object has no attribute ‘right’ for the current.right in the while loop under the insert method.