Write a program to reverse a linked list, both iteratively and recursively.
Implement both approaches for a singly linked list. Each function receives the head of a ListNode chain and returns the new head. For evaluation, linked lists are represented as arrays of node values, with [] representing an empty list.
reverse_linked_list(head) using iteration.reverse_linked_list_recursive(head) using recursion.def reverse_linked_list(head):