the worst time comp. would be o(N2);
o(N) for traversing the linked list and in worst case o(n) for finding starting node of the cycle
can we optimised it further to o(N)
the worst time comp. would be o(N2);
o(N) for traversing the linked list and in worst case o(n) for finding starting node of the cycle
can we optimised it further to o(N)
Hi the best way for cycle detection and removal in linked list is using Floyds concept
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.