Which of the following array position will be occupied by a new element being pushed for a stack of size N elements(capacity of stack > N)?
(a) S[N-1]
(b) S[N]
(c) S[1]
(d) S[0]
This intriguing question originated from Stack using Array in chapter Abstract Data Types of Data Structures & Algorithms I
I had been asked this question during a job interview.