Implement a function that returns the 5th element from the
end in a singly linked list of integers in one pass.
Answer Posted / a.eklare7
int fifth_element_last(node *head)
{
node *p;
int len=0;
p=head;
while(p->next!=NULL)
{
p=p->next;
len++;
}
p=head;
for(int i=1;i<=len-4;i++)
p=p->next;
return(p->data);
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain how can you tell whether two strings are the same?
What are multibyte characters?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
Explain what does it mean when a pointer is used in an if statement?
What is integer constants?
Write a code of a general series where the next element is the sum of last k terms.
will u please send me the placement papers to my mail???????????????????
Write a program to show the change in position of a cursor using c
When should you use a type cast?
What is boolean in c?
What is data types?
How can a number be converted to a string?
What does != Mean in c?
explain what are actual arguments?
Explain the difference between malloc() and calloc() in c?