0
5.1kviews
What is a stack? Give applications of it.

Mumbai University > Information Technology > Sem 3 > Data Structure and Algorithm analysis

Marks: 2 M

Year: May 2014

1 Answer
0
299views

Stack

  1. A stack can be defined as a non-primitive linear data structure which consists of ordered collection of items.
  2. Insertions (additions and pushes) and removals (deletions and pops) of data items takes place at only one end of stack called as top of stack.

3. Applications:

i. Stacks can be used for expression evaluation and syntax parsing. Expressions can be represented in prefix, postfix or infix notations and conversion from one form to another may be accomplished using a stack. Many compilers use a stack for parsing the syntax of expressions, program blocks etc. before translating into low level code.

ii. Stack is internally used by compiler when we implement (or execute) any recursive function. If we want to implement a recursive function non-recursively, stack is programmed explicitly

Please log in to add an answer.