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
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
How to write a multi-statement macro?
How can I do serial ("comm") port I/O?
What is fflush() function?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
What are integer variable, floating-point variable and character variable?
What does == mean in texting?
Is r written in c?
How do you determine a file’s attributes?
What is the difference between ++a and a++?
what value is returned to operating system after program execution?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
what are bit fields in c?
Explain what are its uses in c programming?