The boxes options are all int ,null, cur, void, double, getData,
getTotal, getLink, head, 0, -1
Assume a linked list of integers. Fill in the blanks to implement a recursive algorithm to return the sum of the integers in the linked list. A public helper function that calls the recursive functi given: public getTotal O{ return getTotal (head); } private getTotal (LLNode cur){ if( == > {//base case: end of List or empty return ; } int val = .getData(); return val + .getLink()); )
The boxes options are all int ,null, cur, void, double, getData, getTotal, getLink, head, 0, -1
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
The boxes options are all int ,null, cur, void, double, getData, getTotal, getLink, head, 0, -1
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!