Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Is treeset thread safe?

917


What do you mean by hash table?

1034


What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?

1035


How do you sort an array in decreasing order?

855


What is push and pop in stack?

845


What are examples of data structures?

935


Can map contain duplicate keys?

853


What is the difference between array and list?

921


Which is better merge sort or quick sort?

859


Why is data structure important?

1012


Why is data structure?

871


Explain what are the major data structures used in the hierarchical data model?

1002


What is the space complexity of quicksort?

914


Differentiate between comparable and comparator.

1047


What are the complexity of binary search?

930