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
What happens if we try to insert duplicate key in hashmap?
What does adt stands for?
Write code for reversing a linked list.
What is a hash index?
What do you mean by an Array?
How to get largest and smallest number in an array?
Is binary tree a binary search tree?
What is a string array?
Where is data structure used?
What do you mean by 2-3-4 tree?
Tell me what should be done in the base case for this recursive problem?
What is a Breadth First Search? Give a few of its applications.
How does a heap sort work?
What is the logic to reverse the array?
What is difference between hashmap and hashset?