Print the elements of a linked list