Stack
What is Stack? Stack is a linear data structure which ids used to store in LIFO order (LAST IN FIRST OUT) In this data structure insertion and deletion are performed only one position called TOP. its main objective to evaluate mathematical expression in different notation as prefix, postfix and infix. These are called polish notation. It is a big application of stack .It is also used in different algorithm as Tower of Hanoi, traversal of tree and recursive algorithm. Operation on stack PUSH-operation:- to insert element in stack. POP-operation:- to delete element in stack. Overflow:- full stack. Underflow:- empty stack. Representation of stack using array. In this representation we use one array variable which hold the value of stack and other variable is top that hold the index value. If stack is full/overflow then top must be insilized with (size-1). A stack is called underflow if top is assigned with -1 . in this case we can store limited element ...


👌👌👌
ReplyDelete