Algo is not working for circular linked list. Here is my code -
Floyd_Cycle using if linked list is circular linked list
You just keep taking inputs in the same manner as you did in the others(i.e. insertion at the tail) until you get an element which is already present in the list , in such case you need to check wheather the further elements are same if yess then point the last node to the matching node , else keep taking input …
just store alll the elements and start traversing the list until u get the element which has already occurred before.
[https://ide.codingblocks.com/#/s/17565 ]
the algo works well when their is actual link in the linked list
but for the purpose of this question u are not actually forming any link
refer to the algo i have send in the reply
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.