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 a simple path?
Why sorting is used?
Can a binary tree be empty?
What is the complexity of sorting algorithm?
What is doubly linked list in data structure?
What are the different types of data structures?
Define depth and height of a node?
If we try to add duplicate key to the hashmap, what will happen?
What is the meaning of arraylist?
What is the difference between array list and vector list?
What are linked lists most commonly used for?
What is dynamic array how is it created?
Explain about map and their types?
Define separate chaining?
What do you mean by 2-3-4 tree?