similar to last lab this lab is comprised of a


Similar to last lab, this lab is comprised of a series of mini tasks. In order to get credit for this lab, you must demonstrate proper functionality of all tasks.

In this lab, we will be working with the BstNode class developed in class. For your convenience, it has been included with this lab.

Task 1: Creating a BinarySearchTree class

Recall that we created a BinaryTree in class. For this task, you must create a similar class, called BinarySearchTree, to represent a binary search tree. Note that there is a lot of overlap between a normal binary tree and a binary search tree.

Task 2: Adding an additional constructor to BinarySeachTree

For this task, you must add an additional constructor to the BinarySearchTree class developed in the first task. This constructor will accept an array-based tree as a parameter and convert it into the appropriate BstNode representation. For example, assume that the constructor was passed in the array {10, 5, 15, 2, 9, 12, 50}, the resulting binary search tree would be:

193_Creating a Binary Search Tree program.png

Task 3: Finding the largest and smallest values in the tree Add two class methods (getLargest, getSmallest) that returns references to the largest and smallest values in the binary search tree.

Task 4: Adding an "isFull" method For the final task, you must add a class method for BinarySearchTree called "isFull" that will return true if the tree is full and false otherwise. Recall that a full binary tree is one whose nodes have either 0 or 2 children.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: similar to last lab this lab is comprised of a
Reference No:- TGS0446779

Now Priced at $40 (50% Discount)

Recommended (97%)

Rated (4.9/5)