How can i optimize my “removecycle” function in this code
FLOYD CYCLE, LINKED LIST
hello @snehasai01
ur logic for reading cyclic list is not correct.
use hashmap for creating cyclic list.
and use slow/fast technique for cycle detection and removal.
try to submit ur logic here(code for input and output is already given)->
https://hack.codingblocks.com/app/contests/1788/1307/problem
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.