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 / ruchi

void reverse()
{
nptr p;
int i=0;
p=start;
while(p->next!=NULL)
{
p=p->next;
i=i+1;
}
i++;
while(i)
{
printf("%d\n",p->num);
p=p->prev;
i--;
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an lvalue?

1026


a program that can input number of records and can view it again the record

1875


Explain can static variables be declared in a header file?

1121


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

2170


Here is a good puzzle: how do you write a program which produces its own source code as output?

1057


What does *p++ do? What does it point to?

1012


When would you use a pointer to a function?

1010


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1049


What are pointers? What are different types of pointers?

1081


Explain what is gets() function?

1026


What are the advantages of c language?

1057


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

1186


When is a “switch” statement preferable over an “if” statement?

1094


What does c mean in basketball?

954


What is static volatile in c?

989