GATE CSE
First time here? Checkout the FAQ!
x
0 votes
58 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.4k points)  
closed by | 58 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 Feb 2017
  1. Arjun

    4898 Points

  2. Bikram

    4102 Points

  3. Habibkhan

    3748 Points

  4. Aboveallplayer

    2986 Points

  5. sriv_shubham

    2288 Points

  6. Smriti012

    2222 Points

  7. Arnabi

    1946 Points

  8. Debashish Deka

    1920 Points

  9. mcjoshi

    1614 Points

  10. sh!va

    1462 Points

Monthly Topper: Rs. 500 gift card

20,793 questions
25,951 answers
59,557 comments
21,976 users