Implement a function that returns the 5th element from the
end in a singly linked list of integers in one pass.
Answer Posted / vignesh1988i
let us assume that we have created a linked lists ..... the
no. of nodes is say 15.
count=15;
printf("enter the node do you wann to look out :\n");
scanf("%d",&i);
if(i>count || i>=0)
printf("no node exists like this \n");
else
{
i=count-i;
view_node(i);
printf("%d",HEAD1->data);
}
getch();
}
void view_node(int i)
{
HEAD1=HEAD;
for(int k=1;k<i;k++)
HEAD1=->HEAD1->ptr;
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Describe the steps to insert data into a singly linked list.
What is string concatenation in c?
write a progrmm in c language take user interface generate table using for loop?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What are keywords c?
i want to know the procedure of qualcomm for getting a job through offcampus
Tell me what is the purpose of 'register' keyword in c language?
Which is the memory area not included in C program? give the reason
What is #include stdio h?
What is function definition in c?
What is a structure member in c?
How can you increase the size of a statically allocated array?
What is the difference between test design and test case design?
When can you use a pointer with a function?
Are there namespaces in c?