Predict the output that the following code gives for a linked list given as 1->2->3->4->5->6
cpp
void fun(node* start)
{
if(start == NULL)
return;
cout<data<<" “;
if(start->next != NULL )
fun(start->next->next);
cout<data<<” ";
}
Java
void fun(node start)
{
if(start == null)
return;
System.out.print(start.data+" “);
if(start.next != null )
fun(start.next.next);
System.out.print(start.data+” ");
}
This question what language is used ? Java doesn’t have pointers and Cpp doesn’t have sopln . ???