MCPcopy
hub / github.com/kevin-wayne/algs4 / push

Method push

src/main/java/edu/princeton/cs/algs4/Stack.java:91–97  ·  view source on GitHub ↗

Adds the item to this stack. @param item the item to add

(Item item)

Source from the content-addressed store, hash-verified

89 * @param item the item to add
90 */
91 public void push(Item item) {
92 Node<Item> oldfirst = first;
93 first = new Node<Item>();
94 first.item = item;
95 first.next = oldfirst;
96 n++;
97 }
98
99 /**
100 * Removes and returns the item most recently added to this stack.

Callers 15

mainMethod · 0.95
bfsMethod · 0.95
GraphMethod · 0.95
NFAMethod · 0.95
mainMethod · 0.95
EdgeWeightedDigraphMethod · 0.95
pathToMethod · 0.95
pathToMethod · 0.95
pathToMethod · 0.95
EulerianPathMethod · 0.95
sortMethod · 0.95
DigraphMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected