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

a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

1046


What is fflush() function?

1189


Write a program to print fibonacci series without using recursion?

1217


What are the 32 keywords in c?

1140


can we have joblib in a proc ?

2379


What is header file in c?

1107


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1310


Why does everyone say not to use scanf? What should I use instead?

1469


Can the “if” function be used in comparing strings?

1105


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1304


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1099


When should we use pointers in a c program?

1193


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3371


Explain the use of 'auto' keyword in c programming?

1182


What is #line used for?

1071