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

Method add

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

Source from the content-addressed store, hash-verified

91
92 // 增加num,重复加入算多个词频
93 public static void add(int num) {
94 if (find(1, MAXL, num) != 0) {
95 addCount(1, MAXL, num);
96 } else {
97 key[++cnt] = num;
98 count[cnt] = 1;
99 level[cnt] = random();
100 addNode(1, MAXL, cnt);
101 }
102 }
103
104 // 当前在i号节点的h层,num增加一个词频
105 public static void addCount(int i, int h, int num) {

Callers 1

mainMethod · 0.95

Calls 4

findMethod · 0.95
addCountMethod · 0.95
randomMethod · 0.95
addNodeMethod · 0.95

Tested by

no test coverage detected