create an singly linked lists and reverse the lists by
interchanging the links and not the data?
Answer Posted / vimesh
struct node
{
int data;
node *link;
};
node *p=NULL;
void reverse(*x)
{
node *r,*s,*q;
r=NULL;
q=x
while(q->link!=NULL)
{
s=r;
r=q;
q=q->link;
r->link=s;
}
x=r;
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is difference between rb tree and avl tree?
How to fill element (initialize at once) in an array?
How does selection sort work?
What is non linear structure?
Explain the term recursive case?
Is bubble sort slow?
How to find middle element of linked list in one pass?
What is bubble sort and selection sort?
What do you mean by priority queue?
What is meant by binary tree traversal?
How does a selection sort work for an array?
How do signed and unsigned numbers affect memory?
What is int data type?
How do I rearrange rows in numbers?
Do sets allow duplicates?