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

create an singly linked lists and reverse the lists by
interchanging the links and not the data?

Answer Posted / bharath

I am correcting Vaishali's method here,

We can achive this using following method:
Use three pointers
First is start pointing to first node.
Second is prev pointing to second node
Third is curr pointing to third node.

start->next=NULL;
while(start!=curr)
{
prev->next=start
start=prev;
prev=curr;
curr=curr->next;
}
This reverses the list.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between list and set.

1008


How do you sort a collection in descending order?

866


What is indexing an array?

947


What are the different types of linked list?

791


What differences exist between hashmap and hashtable?

918


What is data algorithm?

936


Which sorting is best in time complexity?

896


Is treemap thread safe?

847


What does a bubble chart show?

838


How does a hashmap work?

866


What's difference between stack and queue?

907


How to get a list of tables, views and columns in firebird database?

836


Why is waste sorting important?

919


When would you use a hashmap?

851


What are b tree keys?

831