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 binary tree and its properties?
What do you know about traversal in linked lists?
What do you mean by breadth first search (bfs)?
What are the advantages and disadvantages of linked list?
What is a hash in programming?
What is a simple graph?
What is a directed graph?
How do you do a selection sort?
What is the best case complexity of quicksort?
How can you insert a node to the beginning of a singly linked list?
What is a binary search tree? Explain with example?
What is stable sort example?
Is list a data type?
Will arraylist maintain insertion order?
How do you find the time complexity of a bubble sort?