Inserting first node in circular LL

Why do we do n->next=n; in the else part of insertion?

Please share the code you are referring

See as bhaiya told in the video that if there’s only a single element in the list then we will do this else we will get segmentation fault cause it won’t add any element at the tail of the circular linked list.

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.