Stack is
2013
Stack is
- A.
Static data structure
- B.
Dynamic data structure
- C.
Inbuilt data structure
- D.
None of these
Attempted by 86 students.
Show answer & explanation
Correct answer: B
Concept: Data structures are often classified by when and how their storage is decided. A structure is termed static when its size is fixed in advance and cannot change while the program runs; it is termed dynamic when its size is determined and may change during program execution. A separate, more general classification calls a structure linear when its elements form a single sequence accessed in order.
Application: A stack is a linear structure that follows the Last-In-First-Out discipline – push adds an item to the top and pop removes the top item. The crucial point for this classification is that the number of items a stack logically holds is not fixed in advance: it increases with every push and decreases with every pop while the program runs. Among the terms offered here, that run-time-changing nature is what the "dynamic" classification names, which is why the standard key treats a stack as a dynamic data structure.
A note on rigour: at the implementation level a stack can be backed either by a fixed-size array or by linked nodes, so a specific implementation may use static storage. The classification asked here is about the logical, conceptual behaviour of the stack as a sequence that grows and shrinks at run time, not about one particular implementation.
Contrast with the other listed terms:
Static – names a structure whose size is settled in advance and frozen for the whole run; that fixed-in-advance idea is not the property the question is pointing to for a stack.
Inbuilt – only says a language ships the structure ready-made; it does not classify the structure by its size behaviour at all, so it does not answer what is being asked.
None of these – not justified, since one of the listed classifying terms does fit the stack under this exam's standard treatment.
Result: Among the options provided, a stack is classified as a dynamic data structure.