Jan 17, 2009

Print a Link list in reverse order. Given: PrintReverse(List *head){} Discuss Pros and cons of Inplace reversal, as compared to reversing by creating

Print a Link list in reverse order.
Given: PrintReverse(List *head){}
Discuss Pros and cons of Inplace reversal, as compared to reversing by creating a new list. They were looking not only for Memory and Space, but also from a concurrency Point of View.
In-place reverse is suitable for concurrency situation, suppose one thread is reversing the linked list, the other thread want to update the value of one node on the list, there is no conflict between these two actions. While creating a new list, the reversing is an atomic action.

No comments:

Post a Comment