Vidyalelo
Data Structure · Q179

Introduction to Data Structures

Programming · Data Structure · question 179

Q179

Given below is the Node class to perform basic list operations and a Stack class with a no arg constructor. Select from the options the appropriate pop() operation that can be included in the Stack class. Also 'first' is the top-of-the-stack. class Node protected Node next; protected Object ele; Node() this(null,null); Node(Object e,Node n) ele=e; next=n; public void setNext(Node n) next=n; public void setEle(Object e) ele=e; public Node getNext() return next; public Object getEle() return ele; class Stack Node first; int size=0; Stack() first=null;

Options are not available for this question.

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board