Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
- 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!
- 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.
- 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.
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started