Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 6. Recursion > Programming Exercises - Pg. 347

347 Exercises 3. 2 tacos, 3 sodas, and 1 ice cream sundae? 4. 1 taco and 1 soda? 5. 1 taco, 1 soda, and 2 ice cream sundaes? 4. Define: a. Base case b. Reduced problem c. General solution 5. Give the generic flowchart for a recursive method that has one base case. 6. Give the four steps in the methodized approach to formulating a recursive algorithm. 7. Give an advantage of a recursive algorithm over an iterative algorithm. 8. Give two advantages of an iterative algorithm over a recursive algorithm. 9. A recursive method is used to calculate 6 4 . The base case is 6 0 . a. What is the first value returned from the recursive invocations? b. What is the second value returned from the recursive invocations? EXERCISES