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 are the two traversal strategies used in traversing a graph?
Explain what are the notations used in evaluation of arithmetic expressions using prefix and postfix forms?
How do you find the complexity of a selection sort?
Can you override methods of arraylist?
How can I study data structures and algorithms?
What is unhashable type list?
Name few concurrent collection classes?
How do you find the height of a binary tree?
How to traverse data in a linked list in forward and backward direction, write the algorithm?
Does linkedhashset allow null values?
Explain the expression trees?
Can we declare array size as a negative number?
Define in brief an array. What are the types of array operations?
If you are given a choice to use either arraylist and linkedlist, which one would you use and why?
Define an algorithm. What are the types of algorithms?