What does the following function do?
public Object some_func()throws emptyStackException
{
if(isEmpty())
throw new emptyStackException("underflow");
return first.getEle();
}
public Object some_func()throws emptyStackException
{
if(isEmpty())
throw new emptyStackException("underflow");
return first.getEle();
}A. pop
B. delete the top-of-the-stack element
C. retrieve the top-of-the-stack element
D. push operation
Answer: Option C
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