Show how the function that you wrote for the previous question satisfies the properties of a recursive function.

What will be an ideal response?


1. computeProduct calls itself.
2. An array of n numbers is passed to the method. The recursive call is given a smaller array of n - 1 numbers.
3. anArray[0] is the base case.
4. Since n ? 1 and the number of entries considered in anArray decreases by 1 at each recursive call, eventually the recursive call is computeProduct(anArray, 1). That is, n is 1, and the base case is reached.

Computer Science & Information Technology

You might also like to view...

Tables are added to the query design workspace using the ________ dialog box

A) Show Table B) Add Tables C) Data Selection D) Quick Info

Computer Science & Information Technology

A presentation saved in PDF format needs to be viewed in a PDF reader

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following is the command for printing a working directory?

a. Mkdir b. Pwd c. rmdir d. cd

Computer Science & Information Technology

What is the final component of the design and implementation of effective policies?  Describe this component.

What will be an ideal response?

Computer Science & Information Technology