Linked list problem | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Linked list problem

https://code.sololearn.com/cW0PU5n9Qck1/?ref=app Why it is not print complete list

5th Nov 2020, 5:51 PM
HK Lite
HK Lite - avatar
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
12th Apr 2024, 7:55 PM
`Š½Ń‚Ń‚į‹Øā“ā°ā¶
`Š½Ń‚Ń‚į‹Øā“ā°ā¶ - avatar