Hi,
On Tue, Nov 24, 2009 at 6:38 PM, Ankur ankuraror...@gmail.com wrote:
What would be the best algorithm for the undermentioned problem.
Implement method PrintFamilyTree() that prints out the Name and
Generation of the tree
Output should resemble
Name: Jan Generation:0
Name: Mike
void PrintFamilyTree(const short generation)
{
printf(Name : %s Generation = %d\n, m_Name.c_str(),generation);
vectorHuman*::iterator it;
for (it = this.begin(); it this.end() ;it++)
{
it-PrintFamilyTree(generation+1);
}
}
On Tue, Nov 24, 2009 at 9:20 PM, Aditya Shankar