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.
Cycle Detection
Cycle Detection
Sort by
recency
|
1353 Discussions
|
Please Login in order to post a comment
I assumed you had to preserve the integrity of the data in the list, I did this as a joke lol
Though replace foo with something cruder...
Isn't this part badly written?
"head refers to the list of nodes 1 -> 2 -> 3 -> 1 -> NULL There is a cycle where node 3 points back to node 1, so return 1."
It says there is a cycle but from 1 it points to NULL,shouldnt instead return to the first value ,as in photos?
Looks like someone messed up the running code?
My Java 8 Solution
Is something wrong with the tests? no solution is working here and this is a little awkward..