Implement a function
reverse_list that takes a singly-linked list of nodes and returns a matching list in the reverse order.
Assume the presence of a class
Node, which exposes the property
next must either be set to the next
Node in the list, or to
null) to indicate the end of the list.
To assist in writing tests, a function
Node.asLinkedList() in Java) has also been defined, which converts a python list to a linked list of
The final tests will use a very long list. Be aware that a recursive solution will run out of
The solution in Python code
Test cases to validate our solution