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

Write an algorithm to check if there is a loop in a doubly linked list.

559


Is bubble sort slow?

525


What are the types of map?

458


What happens if an array goes out-of-bounds?

668


How can I search for data in a linked list?

563






What is heap tree explain with example?

504


How helpful is abstract data type of data structures?

517


Why quicksort is better than merge sort?

483


What is the purpose of tochararray ()?

483


What do you mean by disjoint set adt?

550


Which sorting has less time complexity?

514


write an algorithm to show the procedure of insertion into a b-tree?

531


What is sorting explain?

489


Define depth and height of a tree?

566


What is a circular singly linked list?

507