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
What is difference between list set and map?
Explain the Queue
What is circular queue example?
Define balancing condition for AVL Tree.
Define distributed query and linked server?
State the rules to be followed during infix to postfix conversions?
What is concurrentlinkeddeque?
How do you do a heap sort?
What is difference between arraylist and linkedlist?
Do you know how to find if linked list has loop?
What are hash tables good for?
Tell me how to find middle element of linked list in one pass?
Calculate the address of a random element present in a 2d array, given base address as ba.
How do you sort an arraylist in descending order?
Can arraylist hold duplicates?