diff options
author | RossTheRoss <msattr@gmail.com> | 2019-12-06 11:13:31 -0600 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-12-06 11:13:31 -0600 |
commit | 85db5115ccc88c49d1117a6d2c72c3e25dddf342 (patch) | |
tree | 48b762ae6ad43109e241aa16c1e249f28c6c8fe6 /csci1913/Java | |
parent | Finish lab 12 (diff) | |
download | homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.tar homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.tar.gz homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.tar.bz2 homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.tar.lz homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.tar.xz homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.tar.zst homework-85db5115ccc88c49d1117a6d2c72c3e25dddf342.zip |
Finish lab again
Diffstat (limited to 'csci1913/Java')
-rw-r--r-- | csci1913/Java/lab12_strap012.java | 7 |
1 files changed, 3 insertions, 4 deletions
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<Base> { 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<Base> { 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. |