

MCQOPTIONS
Saved Bookmarks
This section includes 4 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structure knowledge and support exam preparation. Choose a topic below to get started.
1. |
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» B. S[N] | |
2. |
Array implementation of Stack is not dynamic, which of the following statements supports this argument? |
A. | space allocation for array is fixed and cannot be changed during run-time |
B. | user unable to give the input for stack operations |
C. | a runtime exception halts execution |
D. | improper program compilation |
Answer» B. user unable to give the input for stack operations | |
3. |
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] |
Answer» C. S[1] | |
4. |
What does stack underflow refer to? |
A. | accessing item from an undefined stack |
B. | adding items to a full stack |
C. | removing items from an empty stack |
D. | index out of bounds exception |
Answer» D. index out of bounds exception | |