GATE CSE
First time here? Checkout the FAQ!
x
0 votes
64 views

How Can (C) see be answer? stack index starts from 1. I think answer should be S[Top - i] <0 then it will be an underflow.

please check and answer.

closed as a duplicate of: Programming stack
asked in DS by Veteran (14.6k points)  
closed by | 64 views
I think none should be the answer here... how can we check underflow condition with stack value... it should be "top - i < 0" condition not S[top-i]<0 --> here S[top-i] can give unexpected results.


Top Users Apr 2017
  1. akash.dinkar12

    3514 Points

  2. Divya Bharti

    2546 Points

  3. Deepthi_ts

    2040 Points

  4. rude

    1966 Points

  5. Tesla!

    1768 Points

  6. Shubham Sharma 2

    1610 Points

  7. Debashish Deka

    1588 Points

  8. Arunav Khare

    1454 Points

  9. Kapil

    1424 Points

  10. Arjun

    1420 Points

Monthly Topper: Rs. 500 gift card

22,076 questions
28,042 answers
63,233 comments
24,135 users