Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. BinaryTree::TreeNode* BinaryTree::AvlNode::right_Rotate() {
  2. TreeNode* q = L;
  3. L = q->R;
  4. q->R = this;
  5. fix_Height();
  6. q->fix_Height();
  7. return q;
  8. }
  9.  
  10. BinaryTree::TreeNode* BinaryTree::AvlNode::left_Rotate() {
  11. TreeNode* p = R;
  12. R = p->L;
  13. p->L= this;
  14. fix_Height();
  15. p->fix_Height();
  16. return p;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement