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

How does variable declaration affect memory allocation?

1483


Which algorithm is used in collections sort method?

604


State the demerit of linear representation of binary trees?

651


What is a Stack? Explain with example?

696


Describe the types of data structures?

710






Write a program to sum values of given array.

709


Can arraylist contain duplicates?

618


Is radix sort stable?

673


What is thread and types of thread?

681


What is an array vs list?

629


Explain quick sort?

713


which is the simplest file structure? (Sequential, indexed, random)

963


Can arraylist contain null?

619


Define an algorithm. What are the properties of an algorithm? What are the types of algorithms?

691


Do you know what is linear search?

672