create an singly linked lists and reverse the lists by
interchanging the links and not the data?
Answer Posted / vaishali naidu
We can achive this using following method:
Use three pointers
First is start pointing to first node.
Second is prev pointing to second node
Third is curr pointing to third node.
a.while(start!=curr)
{
prev->next=start
start->next=NULL;
start=prev;
prev=curr;
curr=curr->next;
}
| Is This Answer Correct ? | 13 Yes | 21 No |
Post New Answer View All Answers
Which is better merge or quick sort?
There is a program which inserts and deletes node in a sorted singly linked list. There is a bug in one of the modules, how would you debug it?
Parenthesis is never required in postfix or prefix expressions, why?
Define graph traversals?
Who invented merge sort?
What is collection process?
What is perfect binary tree?
Define linked lists?
When is a binary search best applied?
What is entryset in hashmap?
Is arraylist heterogeneous?
Which algorithm is used in collections sort method?
What is unbounded queue?
What is meant by linked list?
Is hashset thread safe?