MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / dequeue

Method dequeue

contents/data-structure/code/Queue/ArrayQueue.java:35–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 }
34
35 @Override
36 public E dequeue() {
37 if (isEmpty()) return null;
38 E target = data[front];
39 data[front] = null; // dereference to help garbage collection
40 front = (front + 1) % data.length;
41 size --;
42 return target;
43 }
44
45 @Override
46 public E peek() {

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected