how to swap two numbers in a linked list without exchanging
the data but only the links?

Answer Posted / sha

let q=20,r=10 and p be a node previous to q
sequence is p-q-r
temp is pointer of link list.
then
temp=p->next;
p->next=temp->next;
p->next->next=temp;
and temp next can be conected to p->next->next->next if
there is any

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1642


Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister

1661


What are the different types of stl containers?

648


sir please send me bpcl previous question papers

1952


What is stl in c++ with example?

632






How connect plc and pc through software

1915


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.

1377


What is stl stand for?

736


What does stl mean in slang?

649


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

1698


Who created stl?

647


What are stl algorithms?

621


What is stl language?

672


Is stl part of c++ standard?

640


What is a standard template library (stl)? What are the various types of stl containers?

667