Examveda

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();
		}
	}
}

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


This Question Belongs to Data Structure >> Introduction To Data Structures

Join The Discussion

Related Questions on Introduction to Data Structures