create an singly linked lists and reverse the lists by
interchanging the links and not the data?
Answer Posted / vimesh
struct node
{
int data;
node *link;
};
node *p=NULL;
void reverse(*x)
{
node *r,*s,*q;
r=NULL;
q=x
while(q->link!=NULL)
{
s=r;
r=q;
q=q->link;
r->link=s;
}
x=r;
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Is treeset thread safe?
What do you mean by hash table?
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?
How do you sort an array in decreasing order?
What is push and pop in stack?
What are examples of data structures?
Can map contain duplicate keys?
What is the difference between array and list?
Which is better merge sort or quick sort?
Why is data structure important?
Why is data structure?
Explain what are the major data structures used in the hierarchical data model?
What is the space complexity of quicksort?
Differentiate between comparable and comparator.
What are the complexity of binary search?