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


Please Help Members By Posting Answers For Below Questions

How do you sort large data?

729


What do you mean by hash table?

726


How does a hashmap work?

663


do records fall under linear or non linear data structures?

1461


Why is tuple immutable?

599






List out the applications of a linked list?

655


How many types of linked list exist?

703


List out the advantages of using a linked list?

636


What are trees in data structures?

644


Define general trees?

728


What is the best data structure and algorithm to implement cache?

685


Which is faster hashmap or treemap?

642


Can tuple be sorted?

668


Does arraylist extend list?

619


Is array part of collection framework?

638