Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

=+What is the procedure for labor relations in the workplace?

Answered: 1 week ago

Question

=+ Are ballots compulsory?

Answered: 1 week ago