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
what is the function of pragma directive in c?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
difference between native and cross compilers
What is bin sh c?
What is nested structure with example?
Explain what is the difference between null and nul?
Explain a file operation in C with an example.
What is a spanning Tree?
What is sizeof int?
Explain main function in c?
write a program to find out prime number using sieve case?
What are the types of type specifiers?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
can we change the default calling convention in c if yes than how.........?