Question: You must assign the grades for a programming class. The class is studying recursion, and students have been given this simple assignment: Write a recursive
You must assign the grades for a programming class. The class is studying recursion, and students have been given this simple assignment: Write a recursive function SumSquares that takes a pointer to a linked list of integer elements and returns the sum of the squares of the elements.
Example:

SumSquares(listPtr) yields (5 * 5) + (2 * 2) + (3 * 3) + (1 * 1)
= 39 Assume that the list is not empty.
You have received quite a variety of solutions. Grade the functions that follow, marking errors where you see them.

list Data 5 2 3 1
Step by Step Solution
3.47 Rating (154 Votes )
There are 3 Steps involved in it
struct ListNode int value ListNode next ... View full answer
Get step-by-step solutions from verified subject matter experts
