In the following function, how many recursive calls are there?

void towers(char source, char dest, char help, int numDisks)
{
if(numDisks<1)
{
return;
}
else
{
towers(source,help,dest,numDisks-1);
cout << "Move disk from " << source << " to " < towers(help,dest,source,numDisks-1);
}
}
a. 0
b. 1
c. 2
d. 3

c. 2

Computer Science & Information Technology

You might also like to view...

Reghosting is the act of resetting SharePoint site pages to the original site definition, removing all customization and reverting the page back to the configuration and layout of the template

Indicate whether the statement is true or false

Computer Science & Information Technology

What is a constructor?

What will be an ideal response?

Computer Science & Information Technology