MCPcopy Create free account
hub / github.com/careercup/ctci / main

Method main

java/Chapter 3/Question3_1/QuestionB.java:14–41  ·  view source on GitHub ↗
(String [] args)

Source from the content-addressed store, hash-verified

12 static int [] buffer = new int [total_size];
13
14 public static void main(String [] args) throws Exception {
15 push(0, 10);
16 push(1, 20);
17 push(2, 30);
18
19 push(1, 21);
20 push(0, 11);
21 push(0, 12);
22
23 pop(0);
24
25 push(2, 31);
26
27 push(0, 13);
28 push(1, 22);
29
30 push(2, 31);
31 push(2, 32);
32 push(2, 33);
33 push(2, 34);
34
35 System.out.println("Final Stack: " + AssortedMethods.arrayToString(buffer));
36
37 pop(1);
38 push(2, 35);
39
40 System.out.println("Final Stack: " + AssortedMethods.arrayToString(buffer));
41 }
42
43 public static int numberOfElements() {
44 return stacks[0].size + stacks[1].size + stacks[2].size;

Callers

nothing calls this directly

Calls 3

pushMethod · 0.95
popMethod · 0.95
arrayToStringMethod · 0.95

Tested by

no test coverage detected