sir I did this question of breaking a cycle in circular link using floyds cycle but it is giving wrong output. can u plzz tell why?
link of solution:https://ide.codingblocks.com/s/107813
Circular linked list of breaking cycle
hi khushi
for breaking a cycle u need to create a cycle
the link list u r making didnt contain a cycle
i will gave u a hint
look if a link list contain cycle and u try to print it it will print infinitely as it contain cycle
but ur code print the whole link list
sir unable to understand you whats wrong in my code i did same as per floyds cycle
for flyod cycle detection u need a linl list which have a cycle but the link list u r making didnt contain a cycle
how to create a cycle plzz help sir
just track the number u r inputing if a number come twice for first time then cycle just point the pointer of previous node to that node
sir i did the same in function detect cycle as you told but it is showing no output.can you plzz tell why? link:https://ide.codingblocks.com/s/109121
plzz look into my code sir?
khushi firstly your print function is wrong also
i think u didnt understand what i say
if u want to remove a cycle then u need a cycle in link list this is what mu saying u r not creating cyclic link list
solve this question first it a geek for geek question in which input link list contain cycle and u have to detect it
https://practice.geeksforgeeks.org/problems/detect-loop-in-linked-list/1
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.