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

Method enqueue

contents/data-structure/code/Queue/ArrayQueue.java:27–33  ·  view source on GitHub ↗
(E e)

Source from the content-addressed store, hash-verified

25 }
26
27 @Override
28 public void enqueue(E e) {
29 if (size == data.length) throw new IllegalStateException("Queue is full");
30 int avail = (front + size) % data.length;
31 data[avail] = e;
32 size ++;
33 }
34
35 @Override
36 public E dequeue() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected