struct node{
int num;
struct node *next;
}
void print(struct node *ptr)
{
if(ptr)
{
printf("%d",ptr->data);
do{
printf("%d",ptr->data);
}
while(ptr->next);
}
}
What is the output, if a $SLL : 1\rightarrow 2\rightarrow 3\rightarrow 4\rightarrow 5$ is passed in the above $C$ code ?
- Assume Head pointer at Node $1$