Question: Suppose there is a class called Person. Person has three fields name(String), father(Person), mother(person). Write a method called checkFamily(String name) which checks the ancestors of
Suppose there is a class called Person. Person has three fields name(String), father(Person), mother(person). Write a method called checkFamily(String name) which checks the ancestors of a given person recursively. For example consider the following tree;

sara.checkFamily(philip) should return true, while sara.checkFamily(ravi) should return false.
Mary Bishop Birth: 1883 Death: 1960
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
