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


Please Help Members By Posting Answers For Below Questions

Which sorting algorithm is best for large data?

547


How many sorting are there in data structure?

576


What can be stored in an arraylist?

567


Does hashmap maintain insertion order?

596


Can arraylist store objects?

537






Can arraylist hold duplicates?

588


Why do we use a multidimensional array in data structure?

671


What is the family trees and connection by clause?

567


What is the difference between data type and data structure?

539


What is application of data structure?

547


What is a postfix expression?

646


What are the Differences between map and hashmap?

583


Explain the difference between a list and array.

625


What is thread and types of thread?

591


What is a sorting algorithm in data structure?

575