×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Delete node of a linear link list using C Reverse The Link List Elements - Link List in C
Display The Link List Elements In C - Link list - C Language
1865    Arnab De    06/09/2019

We can read or display the link list element in two way.

  1. Display from first to last
  2. Display from last to first

Here we use two recursive function for it. Now we create the basic environment of the link list.

softetechnologies
#include<stdio.h>
#include<conio.h>
struct slinearlinklist
{
	int i;
	struct slinearlinklist *next;
};
typedef struct slinearlinklist node;

//prototype declaration
void ftol(node *);
void ltof(node *);


node *head=NULL;

int main()
{
	int c,i,pos;
	while(1)
	{
		printf("\n1. Display From First to Last\n");
		printf("2. Display From Last to First\n");
		printf("3. Exit\n");
		printf("Enter Your choice : ");
		scanf("%d",&c);
		switch(c)
		{
			case 1:
				fotl(head);// First To Last
				break;
			case 2:
				ltof(head); // Last To First
				break;
			case 3:
				exit(0);
		}
	}
}
softetechnologies
void ftol(node *l)
{
	if(l!=NULL)
	{
		printf("%d\n",l->i);
		ftol(l->next);
	}
}
softetechnologies
void ltof(node *l)
{
	if(l!=NULL)
	{
		ltof(l->next);
		printf("%d\n",l->i);
	}
}
Delete node of a linear link list using C Reverse The Link List Elements - Link List in C
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Swami Vivekananda
A nation is advanced in proportion to education and intelligence spread among the masses.
Swami Vivekananda
897
79.53
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     53858
25/06/2018     44927
01/01/2018     43508
28/06/2017     41078
02/08/2017     40051
01/08/2017     34098
06/07/2017     33929
15/05/2017     33179
11/09/2018     29957
14/07/2017     29639
softetechnologies