how to swap two numbers in a linked list without exchanging
the data but only the links?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / siva
head points 20
head=head->link;
link->next;
link->head=head->next
| Is This Answer Correct ? | 1 Yes | 3 No |
Waht is inheritance
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.
I am doing my BS.c MATHS CAN I ABLE TO JOIN IN NIIT?
write a program to convert a decimal number in to its equivalent binary number?
Write a program in C++ returning starting locations of a substring using pointers
write a program that input four digit no and finds it is palindrome or not
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
write a c++ to define a class box with length,breadth and height as data member and input value(),printvalue() and volume() as member functions.
When did c++ add stl?
Explain when u will use Observer pattern and how u will implement in c++ .
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
what is strcture i++ i ++i answer to this i=5 what is the out put