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
Is stl open source?
What is the use of stl?
How is stl different from c++ standard library?
What are stl algorithms?
Name the different types of stl containers.
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.
how to use C++?
Is string part of stl?
How connect plc and pc through software
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.
Can we use stl in coding interviews?
Who created stl?
Why should a c++ programmer be interested in stl?