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

Answer Posted / sanjay rajput

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

typedef struct node NODE;
NODE *p,*start;
p=start->next;
while(p!=NULL)
{
p->next=start;
start=p;
p=p->next;
}

Is This Answer Correct ?    1 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of treemap?

703


List the types of rotations available in splay tree?

925


What type of memory allocation is referred for Linked lists?

984


What are the different data structures?

692


Define tree edge?

683


What is hashing with example?

668


Is a hashmap a dictionary?

622


Why would you use a linked list?

683


What is the use of hashtable?

654


What is the two-dimensional array?

728


What is the order of selection sort?

610


Explain different methods in which you can traverse a tree?

691


What is sorting with example?

651


Can arraylist contain duplicates?

630


Why do we need a data structure?

675