write a java program to reverse the link using recursion
Answers
Answered by
2
write a java program to reverse the link using recursion
- Input : Head of following linked list
- 1->2->3->4->NULL
- Output : Linked list should be changed to,
- 4->3->2->1->NULL
- Input : Head of following linked list
- 1->2->3->4->5->NULL
- Output : Linked list should be changed to,
- 5->4->3->2->1->NULL
- Input : NULL
- Output : NULL
- Input : 1->NULL
- Output : 1->NULL
Similar questions