The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes

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 (16.8k points)
closed by | 128 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.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

28,831 questions
36,676 answers
34,638 users