Working from the definition of Family Tree Node given in the section entitled “Representing family trees in C++,” write a function Family Tree Node *read Family Tree (string filename); that reads in a...


Working from the definition of Family Tree Node given in the section entitled “Representing family trees in C++,” write a function


Family Tree Node *read Family Tree (string filename);


that reads in a family tree from a data file whose name is supplied as the argument to the call. The first line of the file should contain a name corresponding to the root of the tree. All subsequent lines in the data file should have the following form:


child: parent


 where child is the name of the new individual being entered and parent is the name of that child’s parent, which must appear earlier in the data file. For example, if the file Normandy.txt contains the lines


calling read Family Tree("Normandy.txt") should return the family-tree structure shown in Figure 16-2.

Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here