Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or any other basic text. SICP has it, too. And they have exactly the same follow up questiof of "reduce the space usage from O(n) to O(1)", too.

(Incidentally a related method is know as "pollard's rho" and used to factor integers.)



Can you explain how Pollard can be used to find cycles in a linked list?


Please have a look at http://en.wikipedia.org/wiki/Pollard_rho

"The rho algorithm is based on Floyd's cycle-finding algorithm [...]" (which can be found at http://en.wikipedia.org/wiki/Floyd%27s_cycle-finding_algorit...)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: