A small console application for building and displaying a family tree, written as a practice exercise for a university Data Structures and Algorithms module. This is version 2 of the exercise, adding unique identifiers and extended functionality over the first version.
- Add partners to any family member
- Add children to any member with a partner
- Display the whole family tree or a specific branch
- Every family member is assigned a unique ID automatically
The tree is implemented from scratch (no library collections for the tree itself) using a first-child / next-sibling node structure:
src/FamilyTree.javacontains theFamilyTreeclass and its innerFamilyTreeNodeclasssrc/FamilyTreeTest.javacontains the interactive menu-driven test program
Requires a JDK (developed with JDK 23, but any recent version should work).
javac -d out src/*.java
java -cp out FamilyTreeTest
Then follow the menu prompts:
- Enter the ancestor's name
- Use the menu to add partners and children by ID
- View the entire tree or a specific branch
- Select quit to exit
This is a learning project and is not intended for production use.