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?

  1. A.

    Array implementation

  2. B.

    Linked implementation

  3. C.

    Dynamic implementation

  4. 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.

Explore the full course: Bpsc