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

Method add

java/Chapter 3/Question3_4/Tower.java:17–23  ·  view source on GitHub ↗
(int d)

Source from the content-addressed store, hash-verified

15 }
16
17 public void add(int d) {
18 if (!disks.isEmpty() && disks.peek() <= d) {
19 System.out.println("Error placing disk " + d);
20 } else {
21 disks.push(d);
22 }
23 }
24
25 public void moveTopTo(Tower t) {
26 int top = disks.pop();

Callers 15

is_route_between2Function · 0.45
alluniqueFunction · 0.45
mark_as_forbiddenMethod · 0.45
printNodeInternalMethod · 0.45
createTreeFromArrayMethod · 0.45
addWordMethod · 0.45
mainMethod · 0.45
moveTopToMethod · 0.45
pushMethod · 0.45
addEntryMethod · 0.45
addCardToScoreListMethod · 0.45
addCardMethod · 0.45

Calls 3

isEmptyMethod · 0.45
peekMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected