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

What is the use of header?

1087


How can you check to see whether a symbol is defined?

1099


Explain what are run-time errors?

1084


What is the difference between exit() and _exit() function?

1044


What is the symbol indicated the c-preprocessor?

1240


When should a type cast be used?

1010


a value that does not change during program execution a) variabe b) argument c) parameter d) none

1236


How many keywords (reserve words) are in c?

1137


Explain the binary height balanced tree?

1181


What is type qualifiers?

1130


What is double pointer in c?

1038


What is enumerated data type in c?

1073


Explain what is the benefit of using an enum rather than a #define constant?

1218


How can I delete a file?

1060


Is it valid to address one element beyond the end of an array?

1170