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 immutablelist?
Is it possible to insert different type of elements in a stack? How?
Why merge sort is better than insertion sort?
What is default array size?
What is the best complexity of bubble sort?
What is a data structure node class?
Does treemap allow null keys?
How do you empty an arraylist?
What is sorting and classifying?
What is the quickest sorting algorithm?
How do you get placements?
State the rules to be followed during infix to prefix conversions?
List the area of applications of data structure.
Which is faster array or linked list?
Is radix sort stable?