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 swap two numbers in a linked list without exchanging
the data but only the links?

Answer Posted / pavny

Suppose List contains 3 no. 10, 20, 30
try to exchange 10 and 20.
head points to 10.

temp = head;
head = head -> next;
temp -> next = head - next;
head -> next = temp;

I think it works..

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stl in oop?

1220


How do you convert stl to steps?

1161


a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.

1959


how can u do connectivity in c++ language? plz send me connectivity code in c++ ?

2358


Is stl part of c++ standard?

1100


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

2216


What does stl mean in slang?

1122


What is stl stand for?

1238


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

2540


How is stl different from c++ standard library?

1336


how to making game in c++ ?

2730


How connect plc and pc through software

2493


Is string part of stl?

1214


What are the various types of stl containers?

1188


What is stl in c++ with example?

1172