MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / leftRotate

Method leftRotate

src/class148/Code01_AVL1.java:59–66  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

57
58 // i节点为头的树左旋,返回左旋后头节点的空间编号
59 public static int leftRotate(int i) {
60 int r = right[i];
61 right[i] = left[r];
62 left[r] = i;
63 up(i);
64 up(r);
65 return r;
66 }
67
68 // i节点为头的树右旋,返回右旋后头节点的空间编号
69 public static int rightRotate(int i) {

Callers 1

maintainMethod · 0.95

Calls 1

upMethod · 0.95

Tested by

no test coverage detected