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 / dinakaran gct

#include<stdio.h>
struct node *head;
void main();
{
//consider head is the first node
reverse(head);
//here print the reversed link list ...thank you;
}
reverse(struct node *cur)
{
if(cur->next==NULL)
reveres(cur->next)
else{temp=head=cur;}
temp->next=cur;
temp=temp->next;
temp->next=NULL;
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1159


Why does not c have an exponentiation operator?

1051


What is scope rule of function in c?

1100


Explain modulus operator.

1060


I have a varargs function which accepts a float parameter?

1052


How do you list a file’s date and time?

1071


Explain what is the purpose of "extern" keyword in a function declaration?

1074


Combinations of fibanocci prime series

1618


Explain how do you determine a file’s attributes?

1050


What is fflush() function?

1138


Define macros.

1279


Is that possible to add pointers to each other?

1376


What is typedef struct in c?

1051


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1150


Explain that why C is procedural?

1147