Circular linked list

sir ye code sublime m toh shi output de raha hai

Please elaborate on ur approach …

mam mai recursion kar raha hoon starting k element ko le raha hoon linked list k aur puuri linked list se check kar raha hoon ki ye dubara toh nahi hai naa number.
phis ek case khatam hona ke baad m dusraa walaa k liya check kar raha hoon.

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 .

Actually this question is for inputs having no dublicates . So no need for so much calculation . just store alll the elements and start traversing the list until u get the element which has already occurred before.