We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
no, it says 0 <= listSize <= 100. Now, unless their variable names are chosen terribly you could assume that this means there is never more than 100 nodes in the list. therefore if you iterate through 100 times and don't hit a NULL node then you know it must be a cycle
Cookie support is required to access HackerRank
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 →
no, it says 0 <= listSize <= 100. Now, unless their variable names are chosen terribly you could assume that this means there is never more than 100 nodes in the list. therefore if you iterate through 100 times and don't hit a NULL node then you know it must be a cycle