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 are linked lists most commonly used for?
What is the purpose of sorting algorithms?
In tree construction which is the suitable efficient data structure?
What is an recursive algorithm?
How null key is handled in hashmap?
Why is selection sort used?
Define separate chaining?
What is the best case complexity of quicksort?
What is height balanced tree?
Is priority queue sorted?
What are the different types of data type?
What are different techniques for making hash function? Explain with example.
What is the time complexity of arrays sort?
What are data members?
What is the similarity between a Structure, Union and enumeration?