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

Method addCount

src/class149/SkipList1.java:105–115  ·  view source on GitHub ↗
(int i, int h, int num)

Source from the content-addressed store, hash-verified

103
104 // 当前在i号节点的h层,num增加一个词频
105 public static void addCount(int i, int h, int num) {
106 while (next[i][h] != 0 && key[next[i][h]] < num) {
107 i = next[i][h];
108 }
109 if (h == 1) {
110 count[next[i][h]]++;
111 } else {
112 addCount(i, h - 1, num);
113 }
114 len[i][h]++;
115 }
116
117 // 当前在i号节点的h层,插入空间编号为j的节点
118 // 返回值:从i号节点出发,直到把空间编号为j的节点插入,底层总共有多少数字比key[j]小

Callers 1

addMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected