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
What is difference between hashmap and hashtable?
How can you insert a node at the end of linked list?
What is the difference between a hashmap and hashtable?
What is a matrix?
What is a spanning tree?does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
What are the different types of data type?
What is time complexity of sorting algorithms?
What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?
What is difference between hashtable and hashmap?
Write the procedure to convert general tree to binary tree?
Which sorting does collections sort use?
What do u mean by data type?
Explain binary search tree?
Explain what is the bucket size, when the overlapping and collision occur at same time?
Which sorting is stable?