Implementation of a Family Tree with Traversal and Ancestor Finding
VerifiedAdded on 2019/09/23
|2
|977
|130
Project
AI Summary
This assignment requires the development of a program to manage a family tree structure using a general tree. The program must store each family member's name and year of birth. Key functionalities include implementing recursive preorder and postorder traversals, as well as a breadth-first traversal. The core task involves finding common ancestors for specified pairs of family members, displaying them from most recent to least recent. The input is read from a file, detailing the tree structure and ancestor search queries. The output consists of the tree traversals and the identified common ancestors for each query. The program must handle edge cases, including empty trees, and adhere to specific input and output formats.
1 out of 2

