What is the concept of linked list? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the concept of linked list?

2nd Jul 2017, 4:30 PM
Prajakta Dilip Jadhav
4 Answers
+ 1
It is a way to do memory save. You create a structure, for example : typedef struct l{ struct l * next; int data; //can be anything you want }list; Then you use it by keeping the pointer to the first element, and then you can add and remove elements from wherever in the list easily (compared to arrays). If you want, I can do an example of it in the code playground and share it here :)
2nd Jul 2017, 4:50 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
but it is a concept of c as well
2nd Jul 2017, 4:33 PM
Prajakta Dilip Jadhav
0
pls share the code
2nd Jul 2017, 5:05 PM
Prajakta Dilip Jadhav
0
This is a simple implementation of the linked list in C. edit : I can share a safer, more developed and generic version but sololearn's code playground can't run it https://code.sololearn.com/cwymIBitYOAR/?ref=app
2nd Jul 2017, 7:29 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar