Loop in single linked list
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.