Question: Consider the following array implementation of stack: If the array index starts with 0, the maximum value of top that does not cause stack overflow

Consider the following array implementation of stack:

#define MAX 10 Struct STACK { Int arr [MAX]; Int top -1;

If the array index starts with 0, the maximum value of top that does not cause stack overflow is?

A. 8

B. 9 

C. 10 

D. 11

#define MAX 10 Struct STACK { Int arr [MAX]; Int top -1; }

Step by Step Solution

3.33 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Data Structures and Other Objects Using Java Questions!