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 data in computer science?
How do arrays work?
Can we define the size of arraylist?
Which sorting is best in time complexity?
What does adt stands for?
Which collection allows null values?
Which sorting algorithms are in place?
What is the difference between file structure and storage structure?
How to find 3rd element from end in a linked list in one pass?
Which data structure is applied when dealing with a recursive function?
Can arraylist have null values?
What are the advantages of linked list over an array?
Define a full binary tree ?
What are the major data structures used in the rdbms?
Can you sort a hashset?