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

Method main

src/main/java/edu/princeton/cs/algs4/Queue.java:170–180  ·  view source on GitHub ↗

Unit tests the Queue data type. @param args the command-line arguments

(String[] args)

Source from the content-addressed store, hash-verified

168 * @param args the command-line arguments
169 */
170 public static void main(String[] args) {
171 Queue<String> queue = new Queue<String>();
172 while (!StdIn.isEmpty()) {
173 String item = StdIn.readString();
174 if (!item.equals("-"))
175 queue.enqueue(item);
176 else if (!queue.isEmpty())
177 StdOut.print(queue.dequeue() + " ");
178 }
179 StdOut.println("(" + queue.size() + " left on queue)");
180 }
181}
182
183/******************************************************************************

Callers

nothing calls this directly

Calls 9

isEmptyMethod · 0.95
readStringMethod · 0.95
enqueueMethod · 0.95
isEmptyMethod · 0.95
printMethod · 0.95
dequeueMethod · 0.95
printlnMethod · 0.95
sizeMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected