Suppose we have a function rest() that takes an int array and returns a new int array containing everything

Suppose we have a function rest() that takes an int array and returns a new int array containing everything except the original array's first element. Use this to write a recursive function sumSquared that calculates the sum of the squares of elements in an array. JAVA

For example, if arr contains the values 2, 4, and 6, then sumSquared(arr) returns 56, since 4 + 16 + 36 = 56.

Related Posts

This Post Has 4 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *