Explore Link-List and Self-Test

This is an adaptive learning session on Link-List and it is expected that participants will be able to conceptualize the insights of link-list data structure and its beauty.

Basic of Link-List

About Link-List

A linked list is a linear data structure where each element is a separate object. Each element (we will call it a node) of a list is comprising of two items - the data and a reference to the next node. The last node has a reference to null. The entry point into a linked list is called the head of the list.


In the above picture, the head pointer is is pointing to the first node and every node is a self-referential data structure (one data member is info and the other data member is link of type pointer which is referring to itself).

The node in C language can be defined as follows:

struct Node{
               int info;
               struct Node *link; }

We need to declare a pointer and allocate memory to create the above list.

  

You have completed 0% of the lesson
0%