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
How efficient is binary search?
State the difference between primitive and non-primitive data types?
What is data structure definition?
What is meant by int?
What is bubble sort algorithm in data structure sort and searching?
How do you declare An array of three char pointers
What is time complexity of binary search?
Why do we need arrays if all the operations that are performed on arrays can be performed on arraylist?
Can we sort hashmap?
What is meant by balanced binary tree?
What is data structures in computer science?
What is difference between hashmap and hashtable?
How do stacks work?
Calculate the address of a random element present in a 2d array, given base address as ba.
Explain about map and their types?