Priority Queues Interface Implementation Lab 11 Assignment Include word file containing all the required files with the code. Also include test files and t

Priority Queues Interface Implementation Lab 11 Assignment Include word file containing all the required files with the code. Also include test files and their results. Follow the file attached to complete. //————————————————————————// RefSortedList.java
by Dale/Joyce/Weems
Chapter 6
//
// Implements the ListInterface using a linked list. It is kept in increasing
// order as defined by the compareTo method of the added elements. Only
// Comparable elements may be added to a list.
//
// Null elements are not permitted on a list.
//
// One constructor is provided, one that creates an empty list.
//—————————————————————————package ch06.lists;
import support.LLNode;
public class RefSortedList
extends RefUnsortedList
implements ListInterface
{
public RefSortedList()
{
super();
}
public void add(T element)
// Adds element to this list.
{
LLNode prevLoc;
// trailing reference
LLNode location;
// traveling reference
T listElement;
// current list element being compared
// Set up search for insertion point.
location = list;
prevLoc = null;
// Find insertion point.
while (location != null)
{
listElement = location.getInfo();
if (listElement.compareTo(element) < 0) // list element < add element { prevLoc = location; location = location.getLink(); } else break; } // Prepare node for insertion. LLNode newNode = new LLNode(element); // Insert node into list. if (prevLoc == null) { // Insert as first node. newNode.setLink(list); list = newNode; } else { // Insert elsewhere. newNode.setLink(location); prevLoc.setLink(newNode); } numElements++; } } //---------------------------------------------------------------------------// BinarySearchTree.java by Dale/Joyce/Weems Chapter 8 // // Defines all constructs for a reference-based BST //---------------------------------------------------------------------------package ch08.trees; import ch05.queues.*; import ch03.stacks.*; import support.BSTNode; public class BinarySearchTree implements BSTInterface { protected BSTNode root; // reference to the root of this BST boolean found; // used by remove // for traversals protected LinkedUnbndQueue inOrderQueue; // queue of info protected LinkedUnbndQueue preOrderQueue; // queue of info protected LinkedUnbndQueue postOrderQueue; // queue of info public BinarySearchTree() // Creates an empty BST object. { root = null; } public boolean isEmpty() // Returns true if this BST is empty; otherwise, returns false. { return (root == null); } private int recSize(BSTNode tree) // Returns the number of elements in tree. { if (tree == null) return 0; else return recSize(tree.getLeft()) + recSize(tree.getRight()) + 1; } public int size() // Returns the number of elements in this BST. { return recSize(root); } public int size2() // Returns the number of elements in this BST. { int count = 0; if (root != null) { LinkedStack hold = new LinkedStack(); BSTNode currNode; hold.push(root); while (!hold.isEmpty()) { currNode = hold.top(); hold.pop(); count++; if (currNode.getLeft() != null) hold.push(currNode.getLeft()); if (currNode.getRight() != null) hold.push(currNode.getRight()); } } return count; } private boolean recContains(T element, BSTNode tree) // Returns true if tree contains an element e such that // e.compareTo(element) == 0; otherwise, returns false. { if (tree == null) return false; // element is not found else if (element.compareTo(tree.getInfo()) < 0) return recContains(element, tree.getLeft()); // Search left subtree else if (element.compareTo(tree.getInfo()) > 0)
return recContains(element, tree.getRight()); // Search right subtree
else
return true;
// element is found
}
public boolean contains (T element)
// Returns true if this BST contains an element e such that
// e.compareTo(element) == 0; otherwise, returns false.
{
return recContains(element, root);
}
private T recGet(T element, BSTNode tree)
// Returns an element e from tree such that e.compareTo(element) == 0;
// if no such element exists, returns null.
{
if (tree == null)
return null;
// element is not found
else if (element.compareTo(tree.getInfo()) < 0) return recGet(element, tree.getLeft()); // get from left subtree else if (element.compareTo(tree.getInfo()) > 0)
return recGet(element, tree.getRight());
// get from right subtree
else
return tree.getInfo(); // element is found
}
public T get(T element)
// Returns an element e from this BST such that e.compareTo(element) == 0;
// if no such element exists, returns null.
{
return recGet(element, root);
}
private BSTNode recAdd(T element, BSTNode tree)
// Adds element to tree; tree retains its BST property.
{
if (tree == null)
// Addition place found
tree = new BSTNode(element);
else if (element.compareTo(tree.getInfo())
Purchase answer to see full
attachment

Don't use plagiarized sources. Get Your Custom Essay on
Priority Queues Interface Implementation Lab 11 Assignment Include word file containing all the required files with the code. Also include test files and t
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT! Just from $10/Page
Order Essay
Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.