Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the 5 types of organizational structures?

1083


How can I open files mentioned on the command line, and parse option flags?

1074


Which is better oop or procedural?

1072


What is a program flowchart?

1213


What is the code for 3 questions and answer check in VisualBasic.Net?

2164


What is the purpose of & in scanf?

1078


How many types of functions are there in c?

1148


What is a void * in c?

1078


What is floating point constants?

1138


What is the purpose of the statement: strcat (S2, S1)?

1171


What is the right way to use errno?

1060


Explain how can you be sure that a program follows the ansi c standard?

1481


How do you define CONSTANT in C?

1283


What is the argument of a function in c?

1053


What is a const pointer in c?

1132