0
Linked list problem
https://code.sololearn.com/cW0PU5n9Qck1/?ref=app Why it is not print complete list
1 Resposta
0
I made few changes to fixed your code that you attached. I correct the struct Node to contain only data and next pointer. Also change the node assignments in the main function to initialize second and third nodes properly with data and next pointers. Then I updated the insertion in the beginning to maintain the linked list structure. Lastly I correct the printlist function to correctly navigate through the linked list.
Here is the fixed code⤵️
https://sololearn.com/compiler-playground/cwuZ3zFZ1kDw/?ref=app