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

totoo po ba ang manga aliens!

2833


How does an stl file work?

1228


When did c++ add stl?

1294


Why should a c++ programmer be interested in stl?

1153


What do stl stand for?

1202


Is stl open source?

1189


What is a stl vector?

1373


What is stl language?

1217


What does stl stand for in basketball?

1226


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.

2032


write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

3090


What are the symptoms of stl?

1155


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

2298


How stl is different from the c++ standard library?

1288


Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.

2234