code for "Linked List Cycle" (Singly-linked list)