What is Stack? Explain its uses.Stack is a collection of objects that works in LIFO (Last in First out) mechanism. This means that the object that is inserted first is removed last in a stack. Stacks are used in expression evaluations and syntax parsing. Expressions are evaluated from L to R and stacks can be implemented to evaluate them using “Push” and “pop”.What is Stack? Explain its uses.Stack is a Last in First out (LIFO) data structure. It is a linear structure and one can insert and delete from one end only which is called the top. It is very effective in rectifying syntax errors like missing parentheses etc.
|