Oct-23-2020, 08:37 AM
Look at your logic as you walk down the tree:
Am I on an operator?
If so, is the left side empty? (If it is, set the value on the left)
If left side is not empty, make left side the new pointer
At the moment, nothing in the "it is an operator" conditional will examine or redirect to the right. That only happens in the non-operator block.
I'm not sure what logic you're using to create the tree, but you probably need another conditional in there to see if you want to add on the right.
Am I on an operator?
If so, is the left side empty? (If it is, set the value on the left)
If left side is not empty, make left side the new pointer
At the moment, nothing in the "it is an operator" conditional will examine or redirect to the right. That only happens in the non-operator block.
I'm not sure what logic you're using to create the tree, but you probably need another conditional in there to see if you want to add on the right.