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

Method Delete

Programs/Circular_Queue.java:22–42  ·  view source on GitHub ↗
(CircularQueue cq)

Source from the content-addressed store, hash-verified

20 }
21
22 static int Delete(CircularQueue cq) {
23 if (cq.first == null) {
24 System.out.printf ("Circular Queue is empty");
25 return Integer.MIN_VALUE;
26 }
27
28 int value;
29
30 if (cq.first == cq.last) {
31 value = cq.first.value;
32 cq.first = null;
33 cq.last = null;
34 } else {
35 Node n = cq.first;
36 value = n.value;
37 cq.first = cq.first.link;
38 cq.last.link = cq.first;
39 }
40
41 return value ;
42 }
43
44 static void displayCircularQueue( CircularQueue cq) {
45 Node n = cq.first;

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected