1. Engineering
  2. Computer Science
  3. problem 4 consider the recursive c function below void foo...

Question: problem 4 consider the recursive c function below void foo...

Question details

PROBLEM 4: Consider the recursive C++ function below: void foo (unsigned int n) f if (n--0) else cout << tick <endl; foo (n-1); foo (n-1); foo (n-1); 4.A: Complete the following table indicating how many ticks are printed for various parameters n. Unenforceable rule derive your answers by hand - not simply by writing a program calling the function. number of ticks printed when foo (n) is called 2 4 4.B: Derive a conjecture expressing the number of ticks as a function of n complete the following: i.e., Conjecture: for all n20, calling foo(n) results in printed ticks being 4.C: Prove your conjecture from part B (hint Induction!)
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution