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

Method find

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

Source from the content-addressed store, hash-verified

76
77 // 当前在i号节点的h层,返回key为num的节点,空间编号是多少
78 public static int find(int i, int h, int num) {
79 while (next[i][h] != 0 && key[next[i][h]] < num) {
80 i = next[i][h];
81 }
82 if (h == 1) {
83 if (next[i][h] != 0 && key[next[i][h]] == num) {
84 return next[i][h];
85 } else {
86 return 0;
87 }
88 }
89 return find(i, h - 1, num);
90 }
91
92 // 增加num,重复加入算多个词频
93 public static void add(int num) {

Callers 2

addMethod · 0.95
removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected