diff --git a/QueueLink.java b/QueueLink.java index 9d8f774..7742dec 100644 --- a/QueueLink.java +++ b/QueueLink.java @@ -3,7 +3,7 @@ // A linked list (LL) node to store a queue entry class QNode { - int key; + int key = 0; QNode next; // constructor to create a new linked list node @@ -52,7 +52,7 @@ QNode dequeue() // Store previous front and move front one node ahead QNode temp = this.front; - this.front = this.front.next; + //this.front = this.front.next; // If front becomes NULL, then change rear also as NULL if (this.front == null) @@ -78,4 +78,4 @@ public static void main(String[] args) System.out.println("Dequeued item is "+ q.dequeue().key); } -} \ No newline at end of file +}