Posts

Showing posts with the label Data structure

INFIX TO POSTFIX AND POSTFIX EVALUATION (PYTHON)

 Stack Expressions : INFIX TO POSTFIX AND POSTFIX EVALUATION Infix to Postfix Conversion  Infix expression: The expression of the form a op b. When an operator is in-between every pair of operands.  Postfix expression: The expression of the form a b op. When an operator is followed for every pair of operands.  Algorithm: 1. Scan the infix expression from left to right. 2. If the scanned character is an operand, output it. 3. Else,     3.1 If the precedence of the scanned operator is greater than the precedence of the     operator in the stack(or the stack is empty or the stack contains a ‘(‘ ), push it.     3.2 Else, Pop all the operators from the stack which are greater than or equal to in     precedence than that of the scanned operator. After doing that Push the scanned operator     to the stack. (If you encounter parenthesis while popping then stop there and push the  ...

STACK DATA STRUCTURE

    What is Stack Data Structure? Stack is an abstract data type with a bounded(predefined) capacity. It is a simple data structure that allows adding and removing elements in a particular order. Every time an element is added, it goes on the top of the stack and the only element that can be removed is the element that is at the top of the stack, just like a pile of objects.  Basic features of Stack  1. Stack is an ordered list of similar data type. 2. Stack is a LIFO(Last in First out) structure or we can say FILO(First in Last out). 3. push() function is used to insert new elements into the Stack and pop() function is used to remove an element from the stack. Both insertion and removal are allowed at only one end of Stack called Top. 4. Stack is said to be in Overflow state when it is completely full and is said to be in Underflow state if it is completely empty.  Applications of Stack  The simplest application of a stack is to reverse a word. You pus...

INTERVIEW QUS ON DATASTR

 INTERVIEW QUS ON DATASTR MOST IMPORTANT QUESTIONS ON DATA STRUCTURE 1. Define O & Ɵ notation. 2. Explain ‘Stack data structure’ with example. (all operations of stack with ex)  3. Explain ‘Queue data structure’ with example.  4. Explain heap sort with example.  5. Write the applications of Array and difference between array and linked list.  6. What are the working principle of Circular queue, circular linked list and double linked list?  7. Write the algorithm for insertion at begin, at between, at end for single linked list.  8. Define Binary search tree and strictly binary tree with example.  9. Write the algorithms of Insertion, bubble, heap, quick, radix, selection sort  10. Write the procedure of Infix to prefix conversion with example.  11. What is the Linear search technique?  12. Explain AVL tree with creating example.  13. Write the algorithm to evaluate postfix expression.  14. Explain different hash fu...