title: Code with explanation for binary tree rotation (left OR right)
body: <p>I have been trying to wrap my brain around how to write code for rotation of binary tree. I looked at <a href="http://en.wikipedia.org/wiki/Tree_rotation" rel="noreferrer">http://en.wikipedia.org/wiki/Tree_rotation</a> and enfuzzled.com 
  I have been staring at this for 2 hours and have looked at it multiple times earlier. I still see problems in the wikipedia article and cannot understand the other one completely e.g.</p>
  
  <p>Both these lines mentioned in the wikipedia article cannot be true at once</p>
  
  <p>Let P be Q's left child.
  Set P to be the new root.</p>
  
  <p>Can anyone please help?Thanks</p>