that it makes at most one recursive call each time it is invoked this type of recursion is useful when we view an algorithmic problem in terms of first or last element plus remaining set that has the same structure as the original set summing the elements of an array recursively supposefor examplewe are given an arrayaof integers that we wish to sum together we can solve this summation problem using linear recursion by observing that the sum of all integers in is equal to [ ]if or the sum of the first integers in plus the last element in in particularwe can solve this summation problem using the recursive algorithm described in code fragment code fragment summing the elements in an array using linear recursion this example also illustrates an important property that recursive method should always possess--the method terminates we ensure this by writing nonrecursive statement for the case in additionwe always perform the recursive call on smaller value of the parameter ( than that which we are given ( )so thatat some point (at the "bottomof the recursion)we will perform the nonrecursive part of the computation (returning [ ]in generalan algorithm that uses linear recursion typically has the following formtest for base cases we begin by testing for set of base cases (there should be at least onethese base cases should be defined so that every possible chain of recursive calls will eventually reach base caseand the handling of each base case should not use recursion recur after testing for base caseswe then perform single recursive call this recursive step may involve test that decides which of several possible recursive calls to makebut it should ultimately choose to make just one of these calls each time we perform this step moreoverwe should define each possible recursive call so that it makes progress towards base case