Given a pointer pointing to the header of a linked list, how to detect whether the linked list has a loop?
An additional question: how can math knowledge help here?