Using only two pointers how can you tell if a linked-list cycles?
Anonymous
Have both pointers iterate through the list except have one iterate at a faster rate like one traverses by 2 while the other traverses by 1. That way if the faster pointer ever catches up with the slower pointer you know that there is a cycle in the list.
Check out your Company Bowl for anonymous work chats.