Implement a Binary Search Tree to serve as a decision

Implement a Binary Search Tree to serve as a decision tree. The purpose of this decision tree is just to say yes or no the node exists in the tree and prints out the node data. In your node class, you will have String sData; // represents name int iData; // represents place on top ten list Node left; // left child (left subtree) Node right; // right child (right subtree) Implement the necessary methods, including insert and search. NOTE: To compare strings, look at compareTo() method.

In your driver Make a tree, named boysNameTree.

Insert each boy name into the tree.

Search for the names in the list, when found print their name (sData) and placement (iData) on the top ten list.

Search a name not listed and your name.

Create a new tree girlsNameTree.

Insert each girl name into the tree. Search for the names in the list, when found print their name (sData) and placement (iData) on the top ten list.

Search a name not listed and your name.

Print the results of each method call.

Listed below are the top 10 names in the US according to https://www.ssa.gov/oact/babynames/

1 Noah Emma
2 Liam Olivia
3 Mason Sophia
4 Jacob Ava
5 William Isabella
6 Ethan Mia
7 James Abigail
8 Alexander Emily
9 Michael Charlotte
10 Benjamin Harper

 

Leave a Comment

Your email address will not be published. Required fields are marked *

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top