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 / abdur rab

struct node* reverse ( struct node* head )
{
struct node* temp;

if ( NULL == head -> next ) temp = head;
else {
temp = reverse ( head -> next );
head -> next -> next = head;
head -> next = NULL;
}
return ( temp );
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which header file should you include if you are to develop a function which can accept variable number of arguments?

1404


Why should I use standard library functions instead of writing my own?

1274


Why calloc is better than malloc?

1039


What are the back slash character constants or escape sequence charactersavailable in c?

1184


Explain the difference between exit() and _exit() function?

1172


What is a structure and why it is used?

1229


Once I have used freopen, how can I get the original stdout (or stdin) back?

1076


What is equivalent to ++i+++j?

1095


Explain how do you print only part of a string?

1222


What is main () in c?

1075


Describe how arrays can be passed to a user defined function

1297


Do pointers need to be initialized?

1086


What is enumerated data type in c?

1085


The statement, int(*x[]) () what does in indicate?

1149


What is pointer & why it is used?

1122