What does the following function do for a linked list with the first node as head?

public void fun1(Node head)
{
if(head == null)
return;
fun1(head.next);
System.out.println(head.data);
}
a. Print all elements in reverse order.
b. Print all elements in normal order.
c. Prints all elements in random order.
d. Prints the first element.


a. Print all elements in reverse order.

Computer Science & Information Technology

You might also like to view...

In the first step of completing an instruction, which is known as _______, the computer reads the next program instruction to be executed, along with any necessary data, into the processor.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

If you point to a hyperlink in Word, the link to location appears in a  ____.

A. ScreenTip B. bookmark C. shortcut D. browser

Computer Science & Information Technology

Open Source Software (OSS) is freely developed and continuously improved by a large community of software developers

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which Lasso tool is best for selecting areas of the canvas that are geometric in shape?

A. Lasso B. Magnetic Lasso C. Elliptical Lasso D. Polygonal Lasso

Computer Science & Information Technology