Which implementation of a stack requires a fixed amount of memory allocated…
2025
Which implementation of a stack requires a fixed amount of memory allocated for a fixed number of elements?
- A.
Array implementation
- B.
Linked implementation
- C.
Dynamic implementation
- D.
Static implementation
Attempted by 579 students.
Show answer & explanation
Correct answer: A
A stack can be implemented using an array or using linked nodes. In an array implementation, the array size is fixed in advance, so memory for a fixed maximum number of stack elements is allocated beforehand. A linked implementation allocates nodes dynamically, and a dynamic implementation may grow as needed. Although “static” describes fixed allocation, the specific implementation asked here is the array implementation. Therefore, the correct answer is Array implementation.