MCPcopy
hub / github.com/careercup/ctci / main

Method main

java/Chapter 3/Question3_2/Question.java:6–20  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

4
5public class Question {
6 public static void main(String[] args) {
7 StackWithMin stack = new StackWithMin();
8 StackWithMin2 stack2 = new StackWithMin2();
9 for (int i = 0; i < 15; i++) {
10 int value = AssortedMethods.randomIntInRange(0, 100);
11 stack.push(value);
12 stack2.push(value);
13 System.out.print(value + ", ");
14 }
15 System.out.println('\n');
16 for (int i = 0; i < 15; i++) {
17 System.out.println("Popped " + stack.pop().value + ", " + stack2.pop());
18 System.out.println("New min is " + stack.min() + ", " + stack2.min());
19 }
20 }
21
22}

Callers

nothing calls this directly

Calls 8

randomIntInRangeMethod · 0.95
pushMethod · 0.95
pushMethod · 0.95
popMethod · 0.95
popMethod · 0.95
minMethod · 0.95
minMethod · 0.95
printMethod · 0.45

Tested by

no test coverage detected