1.

How To Represent A Linked List Node?

Answer»

The SIMPLEST representation of a LINKED list node is wrapping the data and the link using a typedef STRUCTURE and giving the structure as a Node pointer that points to the NEXT node. An example representation in C is

/*ll stands for linked list*/

typedef struct ll

{

int data;

struct ll *next;

} Node;

The simplest representation of a linked list node is wrapping the data and the link using a typedef structure and giving the structure as a Node pointer that points to the next node. An example representation in C is

/*ll stands for linked list*/

typedef struct ll

{

int data;

struct ll *next;

} Node;



Discussion

No Comment Found