Posts

Learn Stack data structure

 About Stack: A Stack is a simple data structure used for storing data, in which insertion and deletion are done at one end, called Top. Stack Abstract Type:  The following operations make a stack an Abstract Data Type.  Operations:  Main operations: push and pop Auxilliary operations: top, size, isEmptyStack, isFullStack Why and when to use Stack: Balancing of symbols. Infix to postfix conversion. Evaluation of postfix expression. Implementing function calls. Finding of spans (like in stock market). Page history in a web browser. Undo sequence in a text editor. Matching tags in HTML and XML (parses uses stack while tokenising the input) Practice questions: Balancing of symbols using stack. Infix to postfix conversion using stack. Postfix evaluation using stack. Can we evaluate the infix expression with stacks in one pass? How to design a stack such that GetMinnimum() should be O(1). Optimized solution in terms of space for Q5. For a given array with n symbols, how m...