answer 2.

1. start from root.
2. mark it current.
3. save it in temp1 and current->next in temp2;
4. go to (current->next)->next;
5. now make temp2 point to temp1.
6. repeat till the linked list is not fully traversed
7.* make some restriction for first and last node;*
8. the linked list is now reversed.

Time complexit O(n).

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to