+ 1

Can anyone explain what is generalised Linked list?

This topic is related to Data structure in C. It is not about the generic linked list, which is on geekforgeeks. It is like list in list.

17th Nov 2017, 9:27 AM
Rushikesh Khardekar
Rushikesh Khardekar - avatar
2 Respostas
+ 3
(You should remove C++ tag) A linked list is a list (yes, I love to be obvious :p) where each element is a structure that have the value itself (can be anything) and the memory address of the next element of the list (NULL when there is no next element) That is the most simplistic way to represent a linked list (it can be double linked and/or circular also, if you have questions about those two, I'll answer of course :) ) Here is an example of linked list : https://code.sololearn.com/c9va259r6n3x/?ref=app A generic linked list (in C) is when the value is of type void* As you can do auto cast in C, you can cast any primitive type to void* (the opposite is also true) and any pointer type (for non primitive types such as structures or unions, enum can be considered primitive type in this case) Here is an example of generic linked list : https://github.com/Klevh/List
17th Nov 2017, 9:45 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar