Which of the following is an application of a stack data structure?

Options

  • A. Function call management
  • B. Parentheses matching
  • C. Undo operation in software
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

D. More than one of the above

Detailed Explanation

A stack has many important applications. Function calls are managed using a call stack, where the most recently called function returns first. Stacks are also useful for parentheses matching, expression conversion and evaluation, recursion, browser history, and undo operations. Since these tasks often require reversing the order in which items were processed, the LIFO property of a stack is particularly useful.