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 are the 5 types of organizational structures?
How can I open files mentioned on the command line, and parse option flags?
Which is better oop or procedural?
What is a program flowchart?
What is the code for 3 questions and answer check in VisualBasic.Net?
What is the purpose of & in scanf?
How many types of functions are there in c?
What is a void * in c?
What is floating point constants?
What is the purpose of the statement: strcat (S2, S1)?
What is the right way to use errno?
Explain how can you be sure that a program follows the ansi c standard?
How do you define CONSTANT in C?
What is the argument of a function in c?
What is a const pointer in c?