Purchase Solution

Binary Trees: Family tree of two generations

Not what you're looking for?

Ask Custom Question

Create a program that uses the structure of binary trees to make a family tree of two generations. The user should input the names when asked, and then the program should display the names.

Please see the attached Image1.jpg on how the program should store its data.

Attachments
Purchase this Solution

Solution Summary

Solution maintains the binary tree in an array. Comments in the code explain how to access the parent nodes of a tree node in this organization. It is also available as an attachment 129367.cpp that can be compiled using "g++ 129367.cpp".

Solution Preview

#include < unistd.h >
#include < iostream >
#include < string >

using namespace std;

// User (1) + Parents (2) + GrandParents (4) = 7
string twoGenerations[7];

int main()
{
cout << "User Name : ";
getline(cin,twoGenerations[0]);

cout << "Father's Name : ";
getline(cin,twoGenerations[1]);

cout << "Mother's Name : ";
...

Purchase this Solution


Free BrainMass Quizzes
Basic Networking Questions

This quiz consists of some basic networking questions.

C# variables and classes

This quiz contains questions about C# classes and variables.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.