The boxes options are all int ,null, cur, void, double, getData, getTotal, getLink, head, 0, -1
Posted: Sun May 15, 2022 1:51 pm
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()); )
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()); )