How to take the input

In this question, I don’t understand how to take the input in such a way that I can form a cycle in the linked list. If I insert the elements at the tail of the list every time then it won’t form a cycle.
Please suggest how I can possibly take the input?

Hi Sagnik
please refer to the videos content on your portal.

Thanks for mentioning about the video content @AASTHA011, I have watched the videos, one of the video lectures was related to “Taking input to LL”. But in that, it is shown how I can take the input when the LL is terminated by a -1.
With context to this question, since there is a cycle there would be a repetition of the same nodes. I wanted to know how I should take the input in such a way that there would be a cycle formed in the LL.
Pls, help me by giving an idea of making the input function.

https://online.codingblocks.com/player/14014/content/7870/5992
this video is specially made for circular linked list insertion

@sagnik.pal2017 in case of further doubt you can msg me

Actually this link to the video is not working.

the same video would be available in your online course content and if you are having interview preparation course it would be updated very soon

I am having Algo++ course

so the videos might exist in your online portal under the linked list section

@sagnik.pal2017 please check and let me know so that i can contact further if it doesn’t exist

These are the list of videos available:
Which one are you talking about?

i think the video is not available in your course under the linked list section. the videos will be added to your course very soon

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.