Question: hw 1 3 . c Family tree write a program that recursively navigates a family tree to find all relatives of a given person on
hwc Family tree
write a program that recursively navigates a family tree to find all relatives of a given person on the tree
use a linked list of structures to store the data
create a library hwlib.c for all functions except main. You can define them as you wish, but at a minimum you will need something like:
bool load const char filename
bool printAncestors const char name
bool printDescendants const char name
bool printSiblings const char name
bool printCousins const char name
Inputs:
command line arguments:
hw
is the name of a test file containing the list of names and parents, one per line, separated by whitespace
each name is unique
if father or mother are unknown they will have the value "NULL"
Interactive:
once the file is loaded, the program will become interactive. The user will type a name and the program will generate the outputs for that name.
The program will exit when the user types "quit" for the name
Outputs:
for all lists: follow the tree along the male line as far as possible, then step back one generation to the female, then follow that male line etc.
A Print all of s known ancestors
"Ancestors of :
Relation is "father" or "mother" with any appropriate prefix. ie "great great grandmother Sue"
B Print all of s descendants
"Descendants of :
relation is "child", "grand child", "great grand child"
C Print all of s siblings
"Siblings of :
D Print all of s first cousins
"Cousins of :
See testhwbstdout for example of the output formatting
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
