1 1 vote Options are TI==(P/Q*i-1) Ti==(P/Q*i+1) Ti==(P/Q*(i-1)-1) Ti==(P/Q*(i+1)-1) Programming in C made-easy-test-series data-structures stack array + – shivangi5 1.3k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply rfzahid commented Dec 12, 2017 reply Follow flag A: if(Ti == (i - 1)*Q - 1) ? 0 0 replyShare saxena0612 commented Dec 12, 2017 reply Follow flag A) Seems more appropriate because $size \ * \ stack \ index\ $ will give first position and subtracting 1 will provide whether its empty or not ! 0 0 replyShare rfzahid commented Dec 12, 2017 reply Follow flag What is the size of stack here? P/Q or Q? 0 0 replyShare saxena0612 commented Dec 12, 2017 reply Follow flag No of stack=Q each of size P/Q starting index is 0 of both array and stack! 0 0 replyShare Shivansh Gupta commented Dec 12, 2017 i edited by Shivansh Gupta Dec 12, 2017 reply Follow flag It should be $\frac{P}{Q} * i-1$ as we have to skip the $i$ stacks(Stack 0 to stack i-1) each size $\frac{P}{Q}$ 0 0 replyShare Ashwin Kulkarni commented Dec 12, 2017 reply Follow flag It is $\frac{p}{Q}$* i -1 @shivansh That bracket doesn't seem correct. First stack size * index should be done then -1 will give underflow. 0 0 replyShare Please log in or register to add a comment.
0 0 votes condition for overflow is IF ( iP/Q -1 ==0) PRINT→ underflow so option 1 is correct rish1602 answered Feb 5, 2021 rish1602 comment Share Follow 0 reply Please log in or register to add a comment.