MCPcopy Index your code
hub / github.com/algorithmzuo/algorithm-journey / build

Method build

src/class164/Code07_Peaks1.java:154–163  ·  view source on GitHub ↗
(int l, int r)

Source from the content-addressed store, hash-verified

152
153 // 可持久化线段树的build
154 public static int build(int l, int r) {
155 int rt = ++cntt;
156 numcnt[rt] = 0;
157 if (l < r) {
158 int mid = (l + r) / 2;
159 ls[rt] = build(l, mid);
160 rs[rt] = build(mid + 1, r);
161 }
162 return rt;
163 }
164
165 // 数值范围[l..r],加了一个数字jobi,生成新版本的可持久化线段树
166 public static int insert(int jobi, int l, int r, int i) {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected