Question: This code is supposed to return the sum of the node data in a linked list. Correct the bug in the code. Add ptr =

 This code is supposed to return the sum of the node
data in a linked list. Correct the bug in the code. Add

This code is supposed to return the sum of the node data in a linked list. Correct the bug in the code. Add "ptr = ptr->next" to line 6 Change line 5 as ptr == NuLL* Change line 3 as "Node *ptr = NULL;" Add "ptr = ptr-snext" to line 8 Change line 11 as "retum *ptr

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The task is to correct the code to get the sum of the node data in a linked list He... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!