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

Method jump

src/class117/Code01_FlagPlan.java:112–122  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

110 }
111
112 public static int jump(int i) {
113 int aim = line[i][1] + m, cur = i, next, ans = 0;
114 for (int p = power; p >= 0; p--) {
115 next = stjump[cur][p];
116 if (next != 0 && line[next][2] < aim) {
117 ans += 1 << p;
118 cur = next;
119 }
120 }
121 return ans + 1 + 1;
122 }
123
124}

Callers 1

computeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected