Loop in single linked list

来源: 2009-05-15 07:55:51 [旧帖] [给我悄悄话] 本文已被阅读:
Wow, 几天不见,这里正热闹,看来还是Progromers比Mathematician多。怪不得康MM被气得离家出走了。:)
既然大家对Programing感兴趣,给大家做一个。不过,哪位想Progrom也可以。
Any language is ok.

(An interview question)
Given a single linked list with n items.
Find an O(n) algorithm to detect any loops.