copying 2 algos
reverse a linked list