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

What is difference between data type and data structure?

417


How is bubble sort done?

464


Is set sorted?

498


Explain what are the methods available in storing sequential files ?

497


Explain merge sort algorithms.

562






What actions are performed when a function returns?

502


Explain the uses of matrix with an example?

552


Explain the term binding time?

552


Define a set?

566


What does adt stands for?

488


How to print element of Array?

583


What is the difference between list, set and map?

515


Does treeset allow duplicates?

462


What is data type in data structure?

506


Which data structures are used in bfs and dfs algorithm?

568