Actually I was required to only print out every other element in a linked list using recursion but I am very curious if I can use recursion to print out nth element from a linked list.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
linked list has n elements
int element(int current*)
{
current = first
if(current -> next == NULL)
{
cout<<current->info;
}
else
{
return element(current = current -> link -> link->info);
}
}