×
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
1474    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.
Rabindranath Tagore
Don't limit a child to your own learning, for he was born in another time.
Rabindranath Tagore
937
64.31
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     47403
25/06/2018     39491
01/01/2018     39105
28/06/2017     36999
02/08/2017     35724
01/08/2017     29961
06/07/2017     29748
15/05/2017     29229
14/07/2017     25118
11/09/2018     24261
softetechnologies