public boolean hasCycle(ListNode head) {
		if (head == null || head.next == null) {
			return false;
		}
		ListNode ptr0 = head;
		ListNode ptr1 = head.next;
		while (ptr0 != null) {
			if (ptr1 == ptr0) {
				break;
			}

			ptr0 = ptr0.next;

			if (ptr1 == null || ptr1.next == null) {
				break;
			}
			ptr1 = ptr1.next.next;
		}
		if (ptr0 == null || ptr1 == null || ptr1.next == null) {
			return false;
		} else {
			return true;
		}
	}