Question: Mythical Creature Family tree Create a program that simulates a simple family tree of mythical creatures, where the progenitor of the family tree of is
Mythical Creature Family tree
Create a program that simulates a simple family tree of mythical creatures, where the progenitor of the family tree of is at the root, and their descendants are nodes in a binary tree. Each mythical creature can have two direct descendants. The program allows users to search for a specific creature and find their ancestors, as well as print out the tree on Creatures.
Your menu should allow for the user to add a childroot print the tree, and search the tree for a specific creature then print all its ancestors.
In your submission include a screen shot of the "print all" results that show a tree created by your program of at least height Use any creatures you like
Example Output:
Menu
add Root Creature
input:
input Name: Dragon
Menu
add Creature
print all
print specific
input:
Creatures
Dragon
input Node name: Dragon
input L or R child: L
input Name: Wyvern
Menu
add Creature
print all
print specific
input:
Creatures
Dragon
Wyvern
input Node name: Dragon
input L or R child: R
input Name: Drake
Menu
add Creature
print all
print specific
input:
Creatures
Dragon
Wyvern Drake
input Node name: Drake
input L or R child: L
input Name: Hydra
Menu
add Creature
print all
print specific
input:
input Node name: Hydra
The Hydra is descended from the Drake who is descended from the Dragon
Menu
add Creature
print all
print specific
input:
Dragon
Wyvern Drake
Hydra
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
