0 votes
in DBMS by
What is a stack data structure? What are the applications of stack?

1 Answer

0 votes
by

A stack is a data structure that is used to represent the state of an application at a particular point in time. The stack consists of a series of items that are added to the top of the stack and then removed from the top. It is a linear data structure that follows a particular order in which operations are performed. LIFO (Last In First Out) or FILO (First In Last Out) are two possible orders. A stack consists of a sequence of items. The element that's added last will come out first, a real-life example might be a stack of clothes on top of each other. When we remove the cloth that was previously on top, we can say that the cloth that was added last comes out first.

Following are some applications for stack data structure:

  • It acts as temporary storage during recursive operations
  • Redo and Undo operations in doc editors
  • Reversing a string
  • Parenthesis matching
  • Postfix to Infix Expressions
  • Function calls order

Related questions

0 votes
asked Aug 9, 2023 in DBMS by DavidAnderson
0 votes
asked Aug 9, 2023 in DBMS by DavidAnderson
...