From 0db3158baa98294d7088fd056abc5b5d056024f2 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Thu, 5 Dec 2019 10:56:06 -0600 Subject: A --- csci1913/Java/lab12_strap012.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'csci1913') 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 { 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 { 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. -- cgit v1.2.3