A C++ program that models a family tree using smart pointers and recursive algorithms. Uses the Griffin family from Family Guy as example data.
- Count total members in a family tree
- Print the full family tree visually
- Check if two people are related
- Smart pointers (shared_ptr and weak_ptr)
- Cycle detection with unordered_set
- Recursive tree traversal
- Object-oriented design with classes
- How weak_ptr prevents circular reference memory leaks
- How to traverse trees recursively
- How to detect already-visited nodes to avoid infinite loops
Originally created: February 22, 2026 Course: Advanced Data Structures