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 |
write a program that input four digit number and find how many 7 that number contains
What does stl mean in slang?
i want a road rash 3d game code if some one know please help me
what's the difference between abstract class and concreate class? what's the meaning of standard template library(STL)?
What are the symptoms of stl?
Which data structure gives efficient search? A. B-tree B. binary tree C. array D. linked list
21 Answers ABC, Sun Microsystems,
What is a stl vector?
what are you now programming Languages C+
If P is the population on the first day of the year, B is the birth rate, and D is the death rate, the estimated population at the end of the year is given by the formula: The population growth rate is given by the formula: B – D Write a program that prompts the user to enter the starting population, birth and death rates, and n, the number of years. The program should then calculate and print the estimated population after n years. Your program must have at least the following functions: 1. growthRate: This function takes its parameters the birth and death rates, and it returns the population growth rate. 2. estimatedPopulation: This function takes its parameters the current population, population growth rate, and n, the number of years. It returns the estimated population after n years Your program should not accept a negative birth rate, negative death rate, or a population less than 2. please answer my question ....
What are the various types of stl containers?
What do you mean by stl?
Is stl part of c++ standard?