Which of the following array element will return the top-of-the-stack-element for a stack of size N elements(capacity of stack > N)?
(a) S[N-1]
(b) S[N]
(c) S[N-2]
(d) S[N+1]
The question is from Stack using Array in portion Abstract Data Types of Data Structures & Algorithms I
The question was posed to me in an online interview.