Skip to content

Magwerste/FamilyTreeV2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FamilyTreeV2

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.

Features

  • 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

How it works

The tree is implemented from scratch (no library collections for the tree itself) using a first-child / next-sibling node structure:

  • src/FamilyTree.java contains the FamilyTree class and its inner FamilyTreeNode class
  • src/FamilyTreeTest.java contains the interactive menu-driven test program

Running

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:

  1. Enter the ancestor's name
  2. Use the menu to add partners and children by ID
  3. View the entire tree or a specific branch
  4. Select quit to exit

Note

This is a learning project and is not intended for production use.

About

Data Structures & Algorithms (Java)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages