Algorithm for implementing push operation on stack?

1 answer

Answer

1268956

2026-07-31 06:55

+ Follow

1. If TOP = MAXSTK THEN [Stack already filled?]

Print "OVERFLOW"

Go to step 4

Endif

2. TOP = TOP + 1 [Increase TOP by 1]

3. Set ST[STOP] = ITEM [Insert ITEM in new TOP position]

4. End

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.