The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Identify the following:
a. the base case(s) of the function Puzzle
b. the general case(s) of the function Puzzle
2. Show what would be written by the following calls to the recursive function
Puzzle:
a. cout << Puzzle(14, 10);
b. cout << Puzzle(4, 7);
c. cout << Puzzle(0, 0);
3. Given the following function:
int Func(int num)
{
if (num == 0)
return 0;
else
return num + Fun(num + 1);
}
a. Is there a constraint on the values that can be passed as a parameter for this function to pass the smaller-caller test?
b. Is Func(7) a good call? If so, what is returned from the function?
c. Is Func(0) a good call? If so, what is returned from the function?
d. Is Func(-5) a good call? If so, what is returned from the function?
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll