Enter elements into the list

Pls explain to me how can I enter elements into the circular linked list…???

A circular linked list is the one in which the last element of the linked list points to any other element of the linked list. For example, the linked list - 1 2 3 4 5 will be circular if 5’s next pointer will point to any other element.
So for doing this, start taking input values till they are distinct, and keep inserting them in the linked list. When a repeated value occurs, just point the next of the last element to that value in the linked list. That’s it.

how can we keep track of the current element is already present in the linked list or not??

You can use a map and check at each step if the element is present in the linked list or not.

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.