Write a program to reverse a linked list?
Answer Posted / prakash d
struct node *ptr1,*ptr2,*ptr3;
ptr1=start; //pointer points to starting node.
ptr2=ptr1->next;
ptr3=ptr2->next;
ptr1->next=NULL;
ptr2->next=ptr1;
while(ptr3!=NULL)
{
ptr1=ptr2;
ptr2=ptr3;
ptr3=ptr3->next;
ptr2->next=ptr1;
}
start=ptr2;
Is This Answer Correct ? | 13 Yes | 6 No |
Post New Answer View All Answers
write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num
Write a program using display() function which takes two arguments.
Are c and c++ different?
What is the identity function in c++? How is it useful?
program explaining feautures of c++
Why #include is used?
When are exception objects created?
Where the memory to the static variables is allocated?
Write about c++ storage classes?
Difference between a copy constructor and an assignment operator.
What is c++ course?
What do c++ programmers do?
What are the various oops concepts in c++?
Does c++ support exception handling?
What is late binding c++?