Linked Lists k append

sample output running fine but otherwise
giving run error

ur code will not work for k>=n
just do
k=k%n
if(k==0)
print head
else{
function()
print(head)
}

1 Like