第 1 步:slow、fast 都从头出发
第 2 步:slow 走一步,fast 走两步
第 3 步:再来一轮
第 4 步:fast 到头,slow 在正中间
判断链表有没有成环,最经典的办法是【0】。
全部评论