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

Method main

src/class149/SkipList1.java:269–299  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

267 }
268
269 public static void main(String[] args) throws IOException {
270 build();
271 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
272 StreamTokenizer in = new StreamTokenizer(br);
273 PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
274 in.nextToken();
275 int n = (int) in.nval;
276 for (int i = 1, op, x; i <= n; i++) {
277 in.nextToken();
278 op = (int) in.nval;
279 in.nextToken();
280 x = (int) in.nval;
281 if (op == 1) {
282 add(x);
283 } else if (op == 2) {
284 remove(x);
285 } else if (op == 3) {
286 out.println(rank(x));
287 } else if (op == 4) {
288 out.println(index(x));
289 } else if (op == 5) {
290 out.println(pre(x));
291 } else {
292 out.println(post(x));
293 }
294 }
295 clear();
296 out.flush();
297 out.close();
298 br.close();
299 }
300
301}

Callers

nothing calls this directly

Calls 11

buildMethod · 0.95
addMethod · 0.95
removeMethod · 0.95
rankMethod · 0.95
indexMethod · 0.95
preMethod · 0.95
postMethod · 0.95
clearMethod · 0.95
printlnMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected