Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

family tree is a text file that is read in and converted to a binary tree selectIterative Takes a Predicate p and returns the list

image text in transcribed

family tree is a text file that is read in and converted to a binary tree

selectIterative Takes a Predicate p and returns the list of all elements for which p.check is true. The elements must be returned in "in order" traversal order.

df-Adobe Reader View Window Help 51/6| | 109% | Tools Fill & Sign to write test cases for both selectRecursive and selectiterative to make sure the code really works. Your methods will be graded on several additional hidden tests and on the quality of your tests for both methods HINT 3: The provided tests include only one Predicate implementation, IsEven. The hidden tests will use other Predicates, so test your code with other Predicates that you define. To write a new test case, we recommend that you copy/paste an existing one and change the name of the test method. Then draw your test tree on paper so you know what order to insert nodes using insertNode and what your assertions' expected values are. Part 5: Queries that use Select In FamilyRecordQuery.java uncomment the code required for Part 5 in the main method and the classes. As you noticed, the family has a lot of people named Robert and a lot of engineers. Use your selectIterative and selectRecursive to find these people in the family tree. To find all the Roberts, fix the SelectName class and search for the exact string "Robert" in the name field of the FamilyRecord. This must use selectIterative. To find all the Engineers, fix the Select3ob class and search for any text containing "Engineer" in the job field of the FamilyRecord. This must use selectRecursive. This query will output a list of many engineer types (people born in 1920 couldn't have been Software Engineers). Feel free to test our different names or jobs with these queries. To check your work, look at the displayed tree or the CVS file to see that the output is correct Part 6: One more query Uncomment the code in the main method of FamilyRecordQuery.java. Write the code that will return and print out all the people in the family tree that are under the age of 50. Follow the same structure of

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

More Books

Students also viewed these Databases questions

Question

denigration of emotional outbursts; being reserved;

Answered: 1 week ago