19.1 | What is a recursive method? Describe the characteristics of recursive methods . What is an infinite recursion? |
19.2 | Write a recursive mathematical definition for computing 2 n for a positive integer n . |
19.3 | Write a recursive mathematical definition for computing x n for a positive integer n and a real number x . |
19.4 | Write a recursive mathematical definition for computing 1 + 2 + 3 + ... + n for a positive integer n . |
19.5 | How many times is the factorial method in Listing 19.1 invoked for factorial(6) ? |
19.6 | How many times is the fib method in Listing 19.2 invoked for fib(6) ? |
19.7 | Show the output of the following program: |
| |
19.8 | Show the output of the following two programs: |
19.9 | What is wrong in the following method? |
19.10 | Show the call stack for isPalindrome("abcba") using the methods declared in Listing 19.3 and Listing 19.4, respectively. |
19.11 | Show the call stack for selectionSort(new double[]{2, 3, 5, 1}) using the method declared in Listing 19.5. |
19.12 | What is a recursive helper method? |
19.13 | How many times is the moveDisks method in Listing 19.7 invoked for move-Disks(5, 'A', 'B', 'C') ? |
19.14 | Which of the following statements are true?
|
19.15 | What is the cause for the stack overflow exception? |