Right rotate
| 39 | |
| 40 | // Right rotate |
| 41 | struct Node *rightRotate(struct Node *y) |
| 42 | { |
| 43 | struct Node *x = y->left; |
| 44 | struct Node *T2 = x->right; |
| 45 | |
| 46 | x->right = y; |
| 47 | y->left = T2; |
| 48 | |
| 49 | y->height = max(height(y->left), height(y->right)) + 1; |
| 50 | x->height = max(height(x->left), height(x->right)) + 1; |
| 51 | |
| 52 | return x; |
| 53 | } |
| 54 | |
| 55 | // Left rotate |
| 56 | struct Node *leftRotate(struct Node *x) |
no test coverage detected