MCPcopy
hub / github.com/kunal-kushwaha/DSA-Bootcamp-Java / leftRotate

Method leftRotate

lectures/20-trees/code/AVL/AVL.java:99–110  ·  view source on GitHub ↗
(Node c)

Source from the content-addressed store, hash-verified

97 }
98
99 public Node leftRotate(Node c) {
100 Node p = c.right;
101 Node t = p.left;
102
103 p.left = c;
104 c.right = t;
105
106 p.height = Math.max(height(p.left), height(p.right) + 1);
107 c.height = Math.max(height(c.left), height(c.right) + 1);
108
109 return p;
110 }
111
112 public void populate(int[] nums) {
113 for (int i = 0; i < nums.length; i++) {

Callers 1

rotateMethod · 0.95

Calls 2

heightMethod · 0.95
maxMethod · 0.45

Tested by

no test coverage detected