Write a program to reverse a linked list both iteratively and recursively, and explain the space and time complexity of both approaches.