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
Describe the My Computer and My Documents folders; identify the elements that are present in every Window.
What is a standard template library (stl)?
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
What do stl stand for?
How is stl different from c++ standard library?
What are the components of stl?
How do you convert stl to steps?
What is stl language?
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.
What is the stl, standard template library?
Name the different types of stl containers.
Define stl.
how to use C++?
What are the various types of stl containers?
What is the use of stl?