What is the functionality of the following piece of code?
public void display()
{
if(size == 0)
System.out.println("underflow");
else
{
Node current = first;
while(current != null)
{
System.out.println(current.getEle());
current = current.getNext();
}
}
}
public void display()
{
if(size == 0)
System.out.println("underflow");
else
{
Node current = first;
while(current != null)
{
System.out.println(current.getEle());
current = current.getNext();
}
}
}A. reverse the list
B. display the list
C. display the list excluding top-of-the-stack-element
D. reverse the list excluding top-of-the-stack-element
Answer: Option B
Related Questions on Introduction to Data Structures
A. A collection of data values
B. A programming language
C. A set of algorithms
D. A way of organizing and storing data

Join The Discussion