Guided Assignment Problem 3: Call Stack
Your Tasks:
Answer the following questions. Include a function stackchart/diagram for each question to verify your answers.
- Use a call stack to explain the result of calling example(3).
int example(int n) {
  if (n == 0)
return 0;
  else
return example(n – 1) + n * n * n;
}
- Use a call stack to explain how many time(s) the methodfactorial invokes itself with an argument of 5 of factorial(5).
int factorial(int n) {
  if (n == 0)
   return 1;
  else
   return (n * factorial(n – 1));
}
- Include the following items in the same Word file for the finalsubmission:
- Your responses to the two tasks listed above