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...

can i know the source code for reversing a linked list with
out using a temporary variable?

Answer Posted / vishnu948923

struct node* reverse(struct node* first)
{
struct node* cur, temp;
cur=NULL;
while(first!=NULL)
{
temp=first;
first=first->link;
temp->link=cur;
cur=temp;
}
return cur;
}

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to implement a packet in C

2846


Explain the binary height balanced tree?

1136


What is the purpose of sprintf() function?

1065


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

1069


What is preprocessor with example?

1009


Explain what is the difference between far and near ?

1058


List some of the static data structures in C?

1165


What is use of integral promotions in c?

1088


How can you increase the size of a statically allocated array?

1047


What are the types of variables in c?

989


in linking some of os executables are linking name some of them

2085


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1055


What are structure types in C?

1055


How do you redirect a standard stream?

1061


How many types of errors are there in c language? Explain

936