Setting node.parent.left or node.parent.right doesn't remove the node from the treeHey all,
I'm working on an assignment that's due tomorrow, but I've been stuck on this one bug in particular.
I have a BST Node class which holds ref
Latest comments view all › It looks like the parent node only carries a copy of the parent node at creation.
(it was null before it even reached the left = null statement) Does it work now after u updated the code??? When you do getRoot() it is replicating it and then getting it, DynamicSquid is correct, doing setNode() will work but you need to specify how it returns the node it's a copy of the original, so set the Node using setNode(), then specify which root to get, for example, use path.getRoot, and set the path with `System.out.println("Root Path: "
root); `, credits to geeks for geeks:https://www.geeksforgeeks.org/path-getroot-method-in-java-with-examples/ give Dynamic quid t