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...

how to do in place reversal of a linked list(singly or
doubly)?

Answer Posted / ashish gupta

rev()
{
struct node *a1,*a2,*a3;
if(start->next==NULL) /*Only one element exists*/
return;
a1=start;
a2=a1->next;
a3=a2->next;
a1->next=NULL;
a2->next=a1;
while(a3!=NULL)
{
a1=a2;
a2=a3;
a3=a3->next;
a2->next=a1;
}
start=a2;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between malloc() and calloc() function in c language?

1029


What are pointers in C? Give an example where to illustrate their significance.

1167


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1074


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

1209


What does the && operator do in a program code?

1159


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1893


What is the modulus operator?

1152


Why structure is used in c?

1113


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1070


How the c program is executed?

1076


What is the purpose of void in c?

992


What are the types of c language?

976


Explain what math functions are available for integers? For floating point?

1062


What is the difference between typedef and #define?

992


Is a pointer a kind of array?

1115