aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-12-05 10:56:06 -0600
committerRossTheRoss <msattr@gmail.com>2019-12-05 10:56:06 -0600
commit0db3158baa98294d7088fd056abc5b5d056024f2 (patch)
treee91fd35c007d7c0ae9131b7877064af50e5cf2b2 /csci1913
parentStart stuff (diff)
downloadhomework-0db3158baa98294d7088fd056abc5b5d056024f2.tar
homework-0db3158baa98294d7088fd056abc5b5d056024f2.tar.gz
homework-0db3158baa98294d7088fd056abc5b5d056024f2.tar.bz2
homework-0db3158baa98294d7088fd056abc5b5d056024f2.tar.lz
homework-0db3158baa98294d7088fd056abc5b5d056024f2.tar.xz
homework-0db3158baa98294d7088fd056abc5b5d056024f2.tar.zst
homework-0db3158baa98294d7088fd056abc5b5d056024f2.zip
A
Diffstat (limited to '')
-rw-r--r--csci1913/Java/lab12_strap012.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/csci1913/Java/lab12_strap012.java b/csci1913/Java/lab12_strap012.java
index b616111..433f58a 100644
--- a/csci1913/Java/lab12_strap012.java
+++ b/csci1913/Java/lab12_strap012.java
@@ -14,7 +14,7 @@ class PriorityQueue<Base> {
private Node root; // Root node of the BST.
public PriorityQueue() {
root = new Node(null, -1);
- } //root is the One God
+ } //root is the King of Kings
public boolean isEmpty() {
return root.right==root.left;
}
@@ -22,13 +22,13 @@ class PriorityQueue<Base> {
if (isEmpty()) {
throw new IllegalStateException();
} else {
- Node Test = root;
-
+ Node Test = root.right;
+
return Test.object;
}
}
// Unlike the BST’s discussed in the lectures, the nodes in
- //each left subtree have ranks less than or equal to the
+ // each left subtree have ranks less than or equal to the
// rank at the root. The nodes in each right subtree have
// ranks greater than the rank at the root.
// This allows two or more nodes to have the same rank.