pgm to find middle element of linklist(in efficent manner)
Answer Posted / vishnu
typedef struct LL_tag
{
int data ;
struct LL_tag *next ;
} LL ;
/*Pass a valid singly linked list*/
LL* Mid (LL *head)
{
LL *one, *two ;
one = two = head ;
while (two)
{
two = two->next ;
if (two)
{
two = two->next ;
one = one->next ;
}
else
{
two = NULL ;
}
}
return one ;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Write a program to print all permutations of a given string.
write a program to display all prime numbers
Differentiate call by value and call by reference?
Why do we need arrays in c?
Write a program to print fibonacci series without using recursion?
What is difference between union All statement and Union?
What is sizeof return in c?
What are the modifiers available in c programming language?
Write a program to implement queue.
What does *p++ do? What does it point to?
What does *p++ do?
The statement, int(*x[]) () what does in indicate?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
Explain the difference between malloc() and calloc() function?
When is the “void” keyword used in a function?