title: AVL Insert and balance loop
body: <p>I am implementing AVL Trees in C++ on my own code but this problem is more about <strong>understanding</strong> AVL trees rather than the code itself. I am sorry if it doesn't fit here but I have crawled through the Internet and I have still not found a solution to my problem.</p>
  
  <p>My code works as expected with relatively small inputs (~25-30 digits) so I suppose it should work for more. I am using an array in which I hold the nodes I have visited during Insertion and then using a while loop I am raising the heights of each node when needed, I know that <em>this procedure has to end</em> when I find a node whose <em>heights are equal</em> (their subtraction result is 0 that is).</p>
  
  <p>The problem is when it comes to balancing. While I can find the <em>Balance Factor</em> of each node and balance the tree correctly <strong>I am not sure if I should stop adjusting the heights after balancing and just end the Insertion loop</strong> or keep going until the condition is meant, and I just can't figure it out now. I know that during deletion of a node and re-balancing the tree I should keep checking but I am not sure about Insertion and balancing. </p>
  
  <p>Anyone can provide any insight to this and perhaps some documentation?</p>