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


write a C code To reverse a linked list

Answers were Sorted based on User's Feedback



write a C code To reverse a linked list..

Answer / sujith

include <stdio.h>

typedef struct list {
list_t *next;
int data;

}list_t;
list_t *list_reverse(list_t *list)
{
list_t *rlist = NULL;
while (list != NULL)
{
list_t *next = list->next;
list->next = rlist;
rlist = list;
list = next;
}
return rlist;
}
This will do the job.
Plese do verify this.
Sujith

Is This Answer Correct ?    27 Yes 12 No

write a C code To reverse a linked list..

Answer / haymo

sir u can reverse a linklist

Is This Answer Correct ?    16 Yes 2 No

Post New Answer

More C Interview Questions

Differentiate between new and malloc(), delete and free() ?

0 Answers   iNautix,


What is the difference between array and structure in c?

0 Answers  


How to delete a node from linked list w/o using collectons?

0 Answers   Zycus Infotech,


When is a void pointer used?

0 Answers  


how do you execute a c program in unix.

0 Answers  


why we use pointer in c

7 Answers   HCL, TCS,


What is a lookup table in c?

0 Answers  


what is array?

63 Answers   Amdocs, HCL,


Is a house a shell structure?

0 Answers  


What are local static variables?

0 Answers  


What is structure of c program?

0 Answers  


Do pointers take up memory?

0 Answers  


Categories