1 votes 1 votes In a stack,(size of 1 to n) the command to access ith element from top of the stack S will be known as peep(S,i).what is the condition to check for underflow on peep?? A.S[top-i]<=0 B.S[top+i]<=0 C.S[top-i+1]<=0 D.none Smrutiprajna asked Aug 9, 2017 Smrutiprajna 3.6k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes At $Top : 1st$ element. At $Top-1: 2nd$ element. At $Top-2: 3rd$ element. ... At $Top-(i-1): ith$ element. Therefore $ith$ element is existing at $S[Top-i+1]$ which is if $\leq{0}$ implies the value is not existing. therefore C. Aghori answered Aug 10, 2017 Aghori comment Share Follow See all 0 reply Please log in or register to add a comment.