pgm to find middle element of linklist(in efficent manner)
Answer Posted / sharan
NODE display_middle(NODE first)
{
int count = 0;
NODE temp,mid;
for ( temp = mid = first, count=0; temp ; temp = temp ->
link,count++)
{
if ( count % 2 )
{
mid = mid -> link;
}
}
return mid;
}
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is the advantage of an array over individual variables?
Is anything faster than c?
What is difference between structure and union?
What is string constants?
What is the use of typedef in structure in c?
What is file in c language?
Distinguish between actual and formal arguments.
What is a rvalue?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What is 'bus error'?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is New modifiers?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is the use of function overloading in C?
Why header files are used?