Given the following recursive function definition, what is the stopping case?

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. numDisks == 1
b. numDisks >1
c. numDisks < 1
d. numDisks =0


c. numDisks < 1

Computer Science & Information Technology

You might also like to view...

Select protocols that are used for e-mail processing.

a. ETP, FTP b. SMTP, POP3 c. SMTP, POP3, IMAP d. ETP, FTP, SMTP

Computer Science & Information Technology

Analyze the following code:

``` #include using namespace std; class Date { friend void p(); private: int year; int month; int day; }; void p() { Date date; date.year = 2000; cout << date.year; } int main() { p(); return 0; } ``` A. The program compiles and runs fine and display 2000. B. Since year is private, you cannot access it using date.year in function p(). C. The program has a syntax error because year is a private data field in Date. D. The program will have a syntax error if the line friend void p() is deleted.

Computer Science & Information Technology

Percent is a short term for per ________

A) 100 B) 1.00 C) 0.1 D) 0.01

Computer Science & Information Technology

By default, the ruler units are set to ____.

A. inches B. pixels C. picas D. bits

Computer Science & Information Technology