×
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
1337    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.
Albert Einstein
Education is what remains after one has forgotten what one has learned in school.
Albert Einstein
877
58.53
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     44001
01/01/2018     36614
25/06/2018     35919
28/06/2017     34654
02/08/2017     33153
01/08/2017     27623
06/07/2017     27341
15/05/2017     26989
14/07/2017     22634
21/04/2018     21243
softetechnologies