Skip to content

Category Archives: Stack

Prefix: An expression is called the prefix expression if the operator appears in the expression before the operands. Simply of the form (operator operand1 operand2). Example… Read More
Postfix: An expression is called the postfix expression if the operator appears in the expression after the operands. Simply of the form (operand1 operand2 operator). Example… Read More
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… Read More
Given a binary tree. Modify it in such a way that after modification you can have a preorder traversal of it using only the right… Read More
Given a string of balanced expressions, find if it contains a redundant parenthesis or not. A set of parenthesis is redundant if the same sub-expression… Read More
Given a singly linked list, rearrange the list so that even and odd nodes are alternate in the list.There are two possible forms of this… Read More
A simple python List can act as queue and stack as well. Queue mechanism is used widely and for many purposes in daily life. A… Read More
 Output skeeG rof skeeG Given string str, we need to print the reverse of individual words. Examples:  Input : Hello World Output : olleH dlroW… Read More
Deque also known as double ended queue, as name suggests is a special kind of queue in which insertions and deletions can be done at the… Read More
We all know about Stacks also known as Last-In-First-Out(LIFO) structures. Stack primarily has two main operation namely push and pop, where push inserts an element… Read More
Given an array of N distinct elements where elements are between 1 and N both inclusive, check if it is stack-sortable or not. An array… Read More
Prefix and Postfix expressions can be evaluated faster than an infix expression. This is because we don’t need to process any brackets or follow operator… Read More
Given a linked list, print the reverse of it without modifying the list. Examples:  Input : 1 2 3 4 5 6 Output : 6… Read More
Humans use infix expressions on a day-to-day basis, but the nature of infix notation means that compound expressions are generally not evaluated in a linear… Read More
Write a function to print ZigZag order traversal of a binary tree. For the below binary tree the zigzag order traversal will be 1 3… Read More

Start Your Coding Journey Now!