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

Method remove

src/class149/SkipList1.java:147–156  ·  view source on GitHub ↗
(int num)

Source from the content-addressed store, hash-verified

145
146 // 删除x,如果有多个,只删掉一个
147 public static void remove(int num) {
148 int j = find(1, MAXL, num);
149 if (j != 0) {
150 if (count[j] > 1) {
151 removeCount(1, MAXL, num);
152 } else {
153 removeNode(1, MAXL, j);
154 }
155 }
156 }
157
158 // 当前在i号节点的h层,num减少一个词频
159 public static void removeCount(int i, int h, int num) {

Callers 1

mainMethod · 0.95

Calls 3

findMethod · 0.95
removeCountMethod · 0.95
removeNodeMethod · 0.95

Tested by

no test coverage detected