Question: / / list: ptr to a linked list of Node ( each with int data, and Node * next ) / / Return the sum
list: ptr to a linked list of Node each with int data, and Node next Return the sum of all values in the list. You may assume that list is not NULL However, the list may be empty ie listhead may be NULL in which case your code should return O int sumLinkedList list Code may assume that these assertions are true; so does not need to do error checking for these conditions. assertlist NULL; TODO: Insert code here to calculate and return sum of all values in list o if there are none return ; STUB! Replace this line with correct code SUM FAILED: sumlisti Expected: Actual: FAILED: sumlist Expected: Actual: FAILED: sumlist Expected: Actual: FAILED: sumlist Expected: Actual:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
