Guest User

Untitled

a guest
Nov 18th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. void checkCase4(Node *child, Node *grand) {
  2. if (child == child->parent->right && child->parent == grand->left) {
  3. rotate_left(grand, child->parent, child);
  4. child = child->left;
  5. }
  6. else if (child == child->parent->left && child->parent == grand->right) {
  7. rotate_right(grand, child->parent, child);
  8. child = child->right;
  9. }
  10. checkCase5(child, child->parent->parent);
  11. }
  12.  
  13. void Tree::rotate_right(Node *gr, Node *par, Node *ch){
  14. ...
  15. }
Add Comment
Please, Sign In to add comment