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

How do I convert a stl file?

569


What is the stl, standard template library?

600


Who created stl?

656


totoo po ba ang manga aliens!

2342


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.

1383






Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1978


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

1648


please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html

1777


What is stl stack?

665


Can we use stl in coding interviews?

1284


Name the different types of stl containers.

695


Is there any error below, its a code to delete all entires from a map #include #include iostream.h int main() { int i =0; map TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }

1896


Is stl part of c++ standard?

647


how to making game in c++ ?

2183


What is stl in oop?

681