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...

The principal feature of a final report is always the recommendation about the ____ of the incident.

A. final cause B. remediation C. root cause D. mitigation

Computer Science & Information Technology

Explain the difference between method overloading and method overriding.

What will be an ideal response?

Computer Science & Information Technology

Convert hexadecimal FFFF to decimal.

What will be an ideal response?

Computer Science & Information Technology

Which of the following is a requirement for the computer running the VMM server?

A. must have 8 GB RAM B. must be a domain member C. must have at least two hard disks D. must be running Windows Server 2008 Enterprise

Computer Science & Information Technology