• reopened by
5,632 views
2 2 votes
A stack of size (1 to N) and the initial position of top pointer is 0.
get(i,S) is aroutine to get ith element from stack 'S' with respect to top.
then,what is the underflow condition on stack to perform get() operation?
$A) top-i<N$
$B) top-i+1<=N$
$C) top-i<=0$
$D) top-i+1<=0$

1 Answer

5 5 votes

Option D

Position:
Show:

Related questions

3 3 votes
3 3 answers
3.2k
3.2k views
Pankaj Joshi asked Feb 4, 2017
3,205 views
A stack of size (1 to N) and the initial position of top pointer is 0.Get (i, S) is a routine to get ith element from stack ‘S’ with respect to top.Then, what is the unde...
9 9 votes
2 2 answers
467
467 views
GO Classes asked Jul 27
467 views
Given a stack $S$ with $5$ elements from top to bottom as:$2, 4, 6, 8, 10$and an empty queue $Q$.First, remove the elements one by one from $S$ and insert them into $Q$.T...
8 8 votes
2 2 answers
573
573 views
GO Classes asked Jul 27
573 views
Which of the following statements are true?$\text{S1.}$ Stack operations $\texttt{push}$, $\texttt{pop}$, and $\texttt{isEmpty}$ can be worst-case $O(1)$ for a linked-lis...
7 7 votes
1 1 answer
343
343 views
GO Classes asked Jul 10
343 views
Assume there are $n$ elements in the data structure. Consider the following statements:$\text{S1}:$ A stack can be implemented using a linked list such that each individu...