×
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
1630    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
Few are those who see with their own eyes and feel with their own hearts.
Albert Einstein
3451
70.84
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     51492
25/06/2018     43418
01/01/2018     42551
28/06/2017     40300
02/08/2017     39095
01/08/2017     33338
06/07/2017     33052
15/05/2017     32453
14/07/2017     28638
11/09/2018     28390
softetechnologies