2 votes 2 votes Programming in C stack + – Rahul Jain25 asked Oct 7, 2016 retagged Jul 3, 2019 by Cristine Rahul Jain25 633 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Rahul Jain25 commented Oct 8, 2016 reply Follow Share here what does w.r.t to Top means. Pop operation removes top element. so value of I should be 0 or 1???? 0 votes 0 votes ManojK commented Oct 8, 2016 reply Follow Share Is it option B ? 1 votes 1 votes Rahul Jain25 commented Oct 8, 2016 reply Follow Share in key D os given but i think D is not answer. 0 votes 0 votes Please log in or register to add a comment.
Best answer 6 votes 6 votes If we need to get $I^{th}$ element from Top, we require at least $I$ element in stack. So, $Top \geq I$ and underflow condition is $Top < I \\ \implies Top+1 \leq I \\ \implies Top -I+1 \leq 0$ Arjun answered Oct 8, 2016 selected Oct 8, 2016 by ManojK Arjun comment Share Follow See all 3 Comments See all 3 3 Comments reply asu commented Oct 8, 2016 reply Follow Share supppose we have n=5 element,,and bottom of stack is 0 so top will be 4,,,now we want to delete 5th element wrt top(that is 0th element) now top-i+1=4-5+1=0 so 0<=0 but no underflow....after this it can be underflow 1 votes 1 votes Rahul Jain25 commented Oct 8, 2016 reply Follow Share @Arjun sir, if stack contains a,b,c,d,e,f and base-0 which contains a, and top will be be pointing to f, then what will be the 1 st elemtent wrt to top.??? e or f??? 0 votes 0 votes Srken commented Sep 19, 2022 reply Follow Share What does base 0 means 0 votes 0 votes Please log in or register to add a comment.