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

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

2447


What is a standard template library (stl)?

1064


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

2269


What do stl stand for?

1069


How is stl different from c++ standard library?

1252


What are the components of stl?

1051


How do you convert stl to steps?

1106


What is stl language?

1083


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.

1895


What is the stl, standard template library?

1038


Name the different types of stl containers.

1117


Define stl.

1218


how to use C++?

2487


What are the various types of stl containers?

1109


What is the use of stl?

1043