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 are the two forms of #include directive?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
Explain what does the function toupper() do?
Explain which function in c can be used to append a string to another string?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
What is linear search?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
What is the difference between class and object in c?
How can I find out if there are characters available for reading?
What do you mean by c?
What is sizeof return in c?
What are nested functions in c?
Is it better to use malloc() or calloc()?
What is action and transformation in spark?