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 bubble sort?
Run time memory allocation is known as ?
State the demerits of linked representation of binary trees?
Define a priority queue?
How do you sort an arraylist?
Parenthesis is never required in postfix or prefix expressions, why?
What is the difference between arrays sort and collections sort?
Where will be the free node available while inserting a new node in a linked list?
What is difference between data type and variable?
Why is map not a collection?
What is sorted map?
In what areas do data structures are applied?
in tree construction which is the suitable efficient data structure? (Array, linked list, stack, queue)
How to create your own data structure in java?
What are the pre-requisite for the collection to perform binary search?