Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Revise the BSTInterface and the BinarySearchTree class to include the following methods: ( 7 2 points @ 1 2 points each ) A public method
Revise the BSTInterface and the BinarySearchTree class to include the following methods: points @
points each
A public method that returns a count of the number of nodes in the tree that contain a value less than or
equal to the argument value. The header is: public int countLessT maxValueYou can either use a private
helper method that is recursive or write it using iteration.
A public method that returns a count of the number of nodes in the tree that contain a value greater than or
equal to the argument value. The header is: public int countGreaterT minValueYou can either use a private
helper method that is recursive or write it using iteration.
Add a public method height that returns the height of the tree. The header is: public int height Use a private
helper method that is recursive.
Implement the Balance and InsertTree methods from the pseudocode given in section on pages thru
in the text. This is where you are balancing your BST Tree.
Implement and add a BreadthFirst Traversal Level Order Tree Traversal from the pseudocode given in
chapter on pages
Implement and add a fRatiomethod. The method determines the fullness ratio of your binary search tree. It is
the ratio between the trees minimum height based on the number of nodes in the tree and the trees actual
height For example, if a trees minimum height is and its actual height is then its fullness ratio is and
it is relatively balanced. However, if a trees minimum height is and its actual height is then its fullness
ratio is and the tree is unbalanced.
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