Answered step by step
Verified Expert Solution
Link Copied!

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: (72 points @ 12
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 countLess(T maxValue).You 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 countGreater(T minValue).You 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 7.8 on pages 469 thru
471 in the text. This is where you are balancing your BST Tree.
Implement and add a Breadth-First Traversal (Level Order Tree Traversal) from the pseudocode given in
chapter 7 on pages 426-427.
Implement and add a fRatio_method. 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 3 and its actual height is 3 then its fullness ratio is 1.00 and
it is relatively balanced. However, if a trees minimum height is 3 and its actual height is 9 then its fullness
ratio is 0.33 and the tree is unbalanced.

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions