The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
I hadn't seen a rat in 10 years when we moved here - then new neighbours moved in and they decided to get ducks. And suddenly, he's bring in around 5 rats a week...fortunately all recently dead so far, unlike his mice, shrews, voles, moles, and birds.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
Sounds like an old Management-IT story I heard, it goes something like this.
Man #1 is walking along the desert.
Man #2 appears overhead in a hot air balloon.
Man #2 calls down to man #1 asking "Where am I?"
Man #1 calls up to man #2 replying "You are in a balloon, about 50 feet above the ground."
Man #2 calls down "You must be in IT, the answer you gave me is correct but of no use to me."
Man #1 calls up "You must be in Management. You ask a vague question, and blame others when the answer is not what you wanted."
For what it's worth, I can't see a way of balancing a tree in-place. Any tree balancing algorithm I've ever seen traversed a source tree, dismantling it in the process, and created a balanced destination tree.
If your tree is implemented using pointers you may be able to do it by swapping references. That is, if you find a branch that is unbalanced you may mount the branch to another node to make the tree balanced. Same applies to nodes that are unbalanced, just swap them with each other until the tree becomes balanced.