Cisco Systems Interview Question
Software Engineer / DevelopersAwesome..! short and effective by using recursion ...
There are three way to reverse LinkList:
1)Traverse list and store nodes in stack then pop up one by one.
2)Use two pointer one (p) at beginning and one (q) at last now start interchanging with p++ and q--.
3)recursion.
The below function works in a single traversal
- Hawk May 18, 2010