From 85db5115ccc88c49d1117a6d2c72c3e25dddf342 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Fri, 6 Dec 2019 11:13:31 -0600 Subject: Finish lab again --- csci1913/Java/lab12_strap012.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'csci1913') diff --git a/csci1913/Java/lab12_strap012.java b/csci1913/Java/lab12_strap012.java index 3125395..351cc1c 100644 --- a/csci1913/Java/lab12_strap012.java +++ b/csci1913/Java/lab12_strap012.java @@ -17,7 +17,7 @@ class PriorityQueue { root = new Node(null, -1); // root is the lone King of Kings } public boolean isEmpty() { - return root.right==root.left; + return root.right == root.left; } public Base dequeue() { @@ -52,11 +52,10 @@ class PriorityQueue { lessOrEqual = false; } } - if (lessOrEqual) { + if (lessOrEqual) top.left = new Node(object, rank); - } else { + else top.right = new Node(object, rank); - } } } // SNOBBERY. How the aristocracy behaves in a queue. 20 points. -- cgit v1.2.3