(int i, int h, int j)
| 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) { |