MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / Insert

Method Insert

Programs/Circular_Queue.java:10–20  ·  view source on GitHub ↗
(CircularQueue cq, int value)

Source from the content-addressed store, hash-verified

8 static class CircularQueue {Node first, last;}
9
10 static void Insert(CircularQueue cq, int value) {
11 Node n = new Node();
12 n.value = value;
13
14 if (cq.first == null) {
15 cq.first = n;
16 } else { cq.last .link = n; }
17
18 cq.last = n;
19 cq.last.link = cq.first;
20 }
21
22 static int Delete(CircularQueue cq) {
23 if (cq.first == null) {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected