Answer: Stack
Stack is a simple linear data structure used for storing
data.
Stack follows the LIFO (Last In First Out) strategy that states that
the element that is inserted last will come out first.
To implement the Stack, it is required to maintain a pointer to the top
of the Stack, which is the last element to be inserted. Elements of a stack can
be accessed only on the top of the Stack.
Basic Stack Operations:
- void
push(data): an element is inserted into the stack with this operation.
- int
pop(): an element is removed from the top of the stack and is
returned using this operation
Applications of the
Stack
- A Stack
can be used for expression evaluation consisting of operands and
operators.
- Stacks
can be used for Backtracking (to check parenthesis matching in an
expression).
- Stack can
also be used to convert one form of expression to another form (Polish
Notations).
- Stack can
be used for systematic Memory Management.
0 comments:
Post a Comment