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
Can we insert null in set?
How do I rearrange rows in numbers?
What do you mean by recursive definition?
Which is faster arraylist or hashmap?
What does simulation of queues mean?
What are the advantages of linked list over array (static data structure)?
Tell me how to find middle element of linked list in one pass?
What data structure does a binary tree degenerate?
How to pass in data structure exam?
What do you mean by sorting?
How expression trees are gets represented in data structure?
Which collection is used for sort?
Is treeset thread safe?
What is a vector element?
Does mentioning the array name gives the base address in all the contexts?