Answered step by step
Verified Expert Solution
Link Copied!

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.

  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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions