Node Structure of Singly Linked List



Before doing Singly Linked Operations we need to define structure for Linked List. Structure is collection of different data types in a single unit.

Node Structure for Singly Linked List :

struct node {
      int data;
      struct node *next;
}start = NULL;

In the above node structure we have defined two fields in structure -

NoFieldSignificance
1dataIt is Integer Part for Storing data inside Linked List Node
2nextIt is pointer field which stores the address of another structure (i.e node)

Explanation of Node Structure :

  1. We have declared structure of type “NODE”, i.e we have created a Single Linked List Node.
  2. A Node in general language is a Structure having two value containers i.e [Square box having two Partitions]
  3. One value container stores actual data and another stores address of the another structure i.e (Square box having two partitions)
  4. We have declared a structure and also created 1 very first structure called “Start”.
  5. Very first node “Start” contain 1 field for storing data and another field for address of another structure
  6. As this is very first node or Structure, we have specified its next field with “NULL” value.
NULL means “NOTHING” , if next node is unavailable then initialize variable name to NULL.
Consider the topmost example of singly linked list which consists of 3 nodes. The actual linked list will be like this -