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

Method removeNode

src/class149/SkipList1.java:172–186  ·  view source on GitHub ↗
(int i, int h, int j)

Source from the content-addressed store, hash-verified

170
171 // 当前在i号节点的h层,删除空间编号为j的节点
172 public static void removeNode(int i, int h, int j) {
173 if (h < 1) {
174 return;
175 }
176 while (next[i][h] != 0 && key[next[i][h]] < key[j]) {
177 i = next[i][h];
178 }
179 if (h > level[j]) {
180 len[i][h]--;
181 } else {
182 next[i][h] = next[j][h];
183 len[i][h] += len[j][h] - 1;
184 }
185 removeNode(i, h - 1, j);
186 }
187
188 // 查询num的排名
189 public static int rank(int num) {

Callers 1

removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected