Solved

A Linked List Class Uses a Node Class with Successor

Question 15

Multiple Choice

A linked list class uses a Node class with successor reference next and field element to store values.It uses a reference first to point to the first node of the list.Code to print all elements stored in the list can be written as


A) System.out.print(first) ;
B) Node p = first;
While (p != null.
{
System.out.println(p.element.;
P = p.next;
}
C) Node p = first;
While (p != null.
System.out.println(p.next.;
D) Node p = first;
For (p!= null.
{
System.out.println(p.element.;
P++;
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions