Left rotate
| 54 | |
| 55 | // Left rotate |
| 56 | struct Node *leftRotate(struct Node *x) |
| 57 | { |
| 58 | struct Node *y = x->right; |
| 59 | struct Node *T2 = y->left; |
| 60 | |
| 61 | y->left = x; |
| 62 | x->right = T2; |
| 63 | |
| 64 | x->height = max(height(x->left), height(x->right)) + 1; |
| 65 | y->height = max(height(y->left), height(y->right)) + 1; |
| 66 | |
| 67 | return y; |
| 68 | } |
| 69 | |
| 70 | // Get the balance factor |
| 71 | int getBalance(struct Node *N) |
no test coverage detected