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]
Answer:A
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]
Explanation: Since array indexing begins at zero, N-1 is the last index.