You are viewing a single comment's thread. Return to all comments →
Not necessarily. It mayn't find the cycle in first go. So, we can't say it's of O(n).
Seems like cookies are disabled on this browser, please enable them to open this website
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Not necessarily. It mayn't find the cycle in first go. So, we can't say it's of O(n).