create an singly linked lists and reverse the lists by
interchanging the links and not the data?

Answer Posted / mayur bagal

struct node{
int data;
node * next;
};

node *pt2=NULL:
while(root!=NULL)
{
node * temp = root->next;
root->next= pt2;
pt2=root;
root = temp;
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between Array and Array List ? Explain in brief with example.

560


Draw the B-tree of order 3 created by inserting the following data arriving in sequence – 92 24 6 7 11 8 22 4 5 16 19 20 78

1120


Why hashtable is faster than arraylist?

539


What is harvesting in agriculture?

500


How do you do a heap sort?

480






Which is faster array or arraylist?

470


Differentiate file structure from storage structure?

512


Which is the fastest sorting?

622


What is sorting problem?

486


Does hashset maintain order?

490


Explain the uses of binary tree.

497


How many types of linked list exist?

536


How does hashset work internally in java?

516


How does threaded binary tree represented in data structure?

578


What are the goals of data structure?

702