create an singly linked lists and reverse the lists by
interchanging the links and not the data?
Answer Posted / bhanu yadav
reverse(node *first) //first address of first node in linked
{ node *x,*temp,*ttemp;
temp=first; //temp at first
ttemp=temp->next; //ttemp next to temp
while(temp->next!=null)
{ x=ttemp->next;
ttemp->next=temp;
temp=ttemp;
ttemp=x;
}
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Which data structure is used to perform recursion?
What is hashing technique?
Can you please explain the difference between array_name and &array_name?
What is the difference between a Stack and a Queue.
Explain heapsort. What is its complexity?
Which is faster array or list?
How to do the intersection of two sorted arrays?
If you have to store one lakh objects, what will be a better option- a hash map or an array list?
Can we null keys in treemap?
What is precision in data structures?
Differentiate linear from a nonlinear data structure?
Does concat mutate array?
What is the difference between an array and vector?
What is the use of substring?
What are the advantages of array?