I am trying to get a binary search tree to balance, and I know why it's not working, but I don't know how to fix it.
I balance directly in the insert method.
I put some slash to note where the balancing should happen.
Like this the code is not working:
posted 2 years ago
Start with some rubber duck programming. Explain to us in small simple words what the algorithm for balancing the tree is. Then explain what algorithm you are using and where you think the error os.
That may enable you to see the solution without our help.