error…what should i do to avoid infinite cycle?
Circular linked list
I HAVE marked error and correted it just go through it
you have not sent me the link to the correct code?
I have corrected ur cycle detection function
https://ide.codingblocks.com/s/146875...is this the corrected code…because this still shows wrong answer…couldyou send me the proper link?
check this
in this code,where are we calling cycle function?
We are not calling it
Actually the cycle function is to detect cycle in link list
But the input is in the way that we have to create a cycle in the link list and then detect the cycle
Ur cycle detect function is right but the way of input does not create a cycle so there is no use of that function
I simply do that if a number come than from there the cycle begin so simply break there
Other wise ur function is right