Question: Programming Project - Search Trees Submit this completed document along with a .zip of your entire project. Carefully consider your implementation - use the properties

Programming Project - Search Trees

Submit this completed document along with a .zip of your entire project. Carefully consider your implementation - use the properties of BSTs to make your code more efficient.

  1. Complete the implementation of the LinkedBinaryTree and LinkedBinarySearchTree classes from the jsjf package in the example code from class.Specifically, complete the implementation of the removeMax, findMin, findMax, find, getLeft, & getRight methods of the LinkedBinarySearchTree class and any remaining unimplemented methods in LinkedBinaryTree.You should take advantage of the properties of BSTs in your implementation!

  1. make a new sorting method called bstSort which sorts an array of elements using a binary search tree to order the elements.Add your method do the Sorting class from earlier this semester.

  1. make a class called LinkedBSTOrderedSet that implements the methods in the OrderedSet interface.Note that a LinkedBSTOrderedSet is nearly identical to a regular LinkedBinarySearchTree - the only difference is that duplicate elements are not added to a list.

  1. make a method called printTree() that displays the tree as follows:

Leaf nodes appear alone inside parenthesis - (leaf)

Non-leaf nodes appear in parentheses in between the representation of their left & right children - ((leftchild) nonleaf (rightchild)).

For example, after adding 5, 3, 7, 2, & 4 (in that order) to a BST printTree() would display

((( 2 ) 3 ( 4 )) 5 ( 7 ))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!