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 difference between class and object in c?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
What is union and structure?
Why is event driven programming or procedural programming, better within specific scenario?
What is a volatile keyword in c?
FILE PROGRAMMING
Why do we use stdio h and conio h?
What is realloc in c?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What is the difference between the expression “++a” and “a++”?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
Why shouldn’t I start variable names with underscores?
How many types of operators are there in c?
Why is c called c not d or e?
What is %lu in c?