From bd2d6d9a985aa4a95712221bf2535083a6ac87ef Mon Sep 17 00:00:00 2001 From: kittusailley <33256080+kittusailley@users.noreply.github.com> Date: Tue, 31 Oct 2017 18:31:37 +0530 Subject: [PATCH 1/2] Update QueueLink.java --- QueueLink.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QueueLink.java b/QueueLink.java index 9d8f774..5a439b2 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 @@ -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 +} From a74746534390baa99b878a9fae87183e14adb2e9 Mon Sep 17 00:00:00 2001 From: kittusailley <33256080+kittusailley@users.noreply.github.com> Date: Tue, 31 Oct 2017 18:35:39 +0530 Subject: [PATCH 2/2] Update QueueLink.java --- QueueLink.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QueueLink.java b/QueueLink.java index 5a439b2..7742dec 100644 --- a/QueueLink.java +++ b/QueueLink.java @@ -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)