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

Method add

src/class153/Code04_Bookcase1.java:117–124  ·  view source on GitHub ↗
(int s)

Source from the content-addressed store, hash-verified

115 }
116
117 public static void add(int s) {
118 num[++cnt] = s;
119 pos[s] = cnt;
120 size[cnt] = 1;
121 father[cnt] = head;
122 right[head] = cnt;
123 splay(cnt, 0);
124 }
125
126 public static int ask(int s) {
127 int i = pos[s];

Callers 1

mainMethod · 0.95

Calls 1

splayMethod · 0.95

Tested by

no test coverage detected