| 36 | |
| 37 | template <typename T> |
| 38 | Node<T>* LLRotation(Node<T>* p){ |
| 39 | Node<T> *pl, *plr; |
| 40 | pl = p -> lchild; |
| 41 | plr = pl -> rchild; |
| 42 | |
| 43 | pl -> rchild = p; |
| 44 | p -> lchild = plr; |
| 45 | p -> height = nodeHeight(p); |
| 46 | pl -> height = nodeHeight(pl); |
| 47 | // plr's height remains same; |
| 48 | |
| 49 | if(root == p) |
| 50 | root = pl; |
| 51 | |
| 52 | return pl; |
| 53 | } |
| 54 | |
| 55 | template <typename T> |
| 56 | Node<T>* RRRotation(Node<T>* p){ |
no test coverage detected