This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Data Structures and Algorithms in Java (Third Edition) M. T. Goodrich and R. Tamassia John Wiley & Sons
Solution of Exercise C-4.1 The recursive algorithm, product(n, m), for computing product using only addition and subtraction, is as follows: If m = 1 return n. Otherwise, return n plus the result of a recursive call to the method product with parameters n and m − 1.