×
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
1067    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
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whol
Albert Einstein
515
50.7
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     41364
01/01/2018     35770
28/06/2017     33774
25/06/2018     32831
02/08/2017     32142
06/07/2017     26594
01/08/2017     26559
15/05/2017     26214
14/07/2017     21527
21/04/2018     20512
softetechnologies