ABSTRACT

Recursive methods can be categorized according to the number of times they invoke themselves in the recursive cases. This chapter examines methods that not only call themselves just once, but also process the output of the recursive call before producing or returning their own result. According to the methodology, the first step consists of determining the size of the problem, which is related to the input parameters. It is an example of linear recursion since there is only one function call in the recursive case, and the recursive call is not the last operation that the algorithm performs in the recursive case. It is possible to design more efficient algorithms that calculate powers, which run in logarithmic time, by considering a subproblem of half the size in the decomposition stage. Pascal's triangle is the triangular arrangement of binomial coefficients. The algorithms are allowed to add and subtract numbers, but they may not use the multiplication operator.