Professional Documents
Culture Documents
Linked Lists
Linked Lists
Pratik Narang
BITS Pilani
Pilani Campus
BITS Pilani
Pilani Campus
Linked Lists
Self-referential structures
• Each component within the structure includes a pointer indicating
where the next component can be found
• Useful for linked data structures
• Relative ordering of components can be easily altered using pointers
• Addition or deletion is easily done by altering pointers
• No pre-defined maximum size – can grow or shrink
Creating a Linked list
struct node
{
int data;
struct node *next;
};
typedef struct node Node;