MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / LLRotation

Function LLRotation

CPP/AVL Trees/AVL_Trees.cpp:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template <typename T>
38Node<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
55template <typename T>
56Node<T>* RRRotation(Node<T>* p){

Callers 1

insert_bst_recursiveFunction · 0.85

Calls 1

nodeHeightFunction · 0.85

Tested by

no test coverage detected