What does Stack refer to?
- A. A self-balancing binary search tree where the height difference between subtrees is at most one.
- B. A linear data structure that follows the Last-In-First-Out (LIFO) principle. ✓
- C. A binary tree in which each node's left subtree contains smaller values and right subtree contains larger values.
- D. A structure that stores elements in contiguous memory locations, allowing constant-time indexed access.
Correct answer
B. A linear data structure that follows the Last-In-First-Out (LIFO) principle.
Explanation
Stack refers to a linear data structure that follows the Last-In-First-Out (LIFO) principle.