Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve the question --Solve in {java} data structure In this project, you will implement an AVL tree data structure using the Names files (attached).

Please solve the question

--Solve in {java}

data structure

In this project, you will implement an AVL tree data structure using the Names files

(attached). The tree nodes will represent a Name object that has the following attributes:

Baby name

Baby gender

A linked list that contains the frequencies of this baby name in different years.

The name object is comparable using both the baby's name and gender together.

You will represent all the names in all the files. This means that you will load all the files

with all the names in them, file by file and add them to the tree. There will be two cases

for this:

1. A name-gender does not exist in the AVL tree (it is the first time that it appears in

any of the files), in this case, the name will be added as a new node to the tree.

Then you will insert a node in the linked list for the frequency of this year.

2. A name-gender exists as a node in the tree (the same name and gender were

added by a file from a previous year); in this case, you will only insert an object

into the linked list of this tree node.

---------------------------------------------------------

--------Data file------

name file is --> USA_yob2000.txt

data---->>

Sussan,F,6

Kourtnei,F,6

Jozelyn,F,7

Amor,M,7

Nesta,M,8

Jarin,F,8

Latrel,M,9

Laverne,M,9

Oni,F,10

Hagar,F,11

Chinedu,M,12

Kelani,F,14

Orion,F,15

Abbygayle,F,17

Myiah,F,19

Marque,M,23

Saja,F,26

Andraya,F,32

Suzannah,F,40

Ariadne,F,52

Quran,M,74

Jalyn,M,113

Lamont,M,214

Alisha,F,715

Mylie,F,139

Jenai,F,9

Viktorya,F,5

Zakariyah,M,7

Ellise,F,18

-----------------------------------------------------------------------------

name file is --> USA_yob2001.txt

data---->>

Kelani,F,14

Chinedu,M,5

Andraya,F,22

Hagar,F,5

Abbygayle,F,28

Laverne,M,5

Amor,F,15

Jarin,F,8

Alisha,F,684

Jalyn,F,316

Saja,F,25

Jalyn,M,122

Amor,M,5

Jarin,M,60

Orion,M,404

Ariadne,F,63

Jozelyn,F,8

Tyleik,M,7

Marque,M,25

Quran,M,61

Orion,F,16

Suzannah,F,24

Milene,F,6

Myiah,F,20

Ahmeir,M,6

Naji,M,15

Soraya,F,170

Alila,F,5

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_2

Step: 3

blur-text-image_3

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

Practical Introduction To Data Structures And Algorithm Analysis Java Edition

Authors: Clifford A. Shaffer

1st Edition

0136609112, 978-0136609117

More Books

Students also viewed these Programming questions

Question

36. Let p0 = P{X = 0} and suppose that 0 Answered: 1 week ago

Answered: 1 week ago