create an singly linked lists and reverse the lists by
interchanging the links and not the data?

Answer Posted / vijayan

struct node{
int data;
node * next;
};
node *pt1,*pt2=NULL:
while(root!=NULL)
{
pt1=root;
root=root->next;
pt1->next=pt2;
pt2=pt1;
}

Is This Answer Correct ?    31 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by back edge?

700


Can you store different types in an array?

578


What are the types of map?

538


Define an abstract data type (adt)?

656


What are priority queues?

594






Define balance factor of a node in avl tree?

683


What is ascending and descending order?

577


What are the tasks performed during preorder traversal?

697


What is data structure and why it is important?

572


What is an example of an array?

644


Define parent node?

617


Does map extend iterable?

536


Why is hashmap faster?

570


How do you find the index of an element in an arraylist?

526


Define non-linear data structures?

641