Write a program that uses recursive backtracking to find all ancestors and descendants of a person given

Question:

Write a program that uses recursive backtracking to find all ancestors and descendants of a person given a file of familial relationships. For ancestors it must show all parents, all grandparents, all great grandparents, etc. For descendants it must show all children, all grandchildren, all great grandchildren, etc. The program also must use indentation to make it clear who is a parent of whom and who is a child of whom. Write two recursive methods that use backtracking to explore for ancestors and descendants respectively. Here is a possible example dialogue:

Input file? tudor.dat Whose info? Margaret Ancestors: Margaret Elizabeth of York Henry VII Descendants: Margaret James V Mary, Queen of Scots James VI & I Margaret Stuart Henry, Lord Darnley James VI & I

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: