## Delete middle element of a stack

Given a stack with push(), pop(), empty() operations, delete middle of it without using any additional data structure. Input : Stack[] = [1, 2, 3,… Read More »

- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Introduction to Data Structures | 10 most commonly used Data Structures
- Iterative Postorder traversal | Set 3
- Print the last k nodes of the linked list in reverse order | Iterative Approaches
- Find maximum in stack in O(1) without using additional stack
- Check if the two given stacks are same
- Sum of Bitwise-OR of all Submatrices
- Sum of bitwise AND of all submatrices
- InfyTQ 2019 : Find the position from where the parenthesis is not balanced
- Design a stack which can give maximum frequency element
- Reverse the Sentence using Stack
- Delete all even elements from a stack
- Print leaf nodes in binary tree from left to right using one stack
- Implementing Forward Iterator in BST
- Analyzing BufferOverflow with GDB
- Nodes from given two BSTs with sum equal to X
- Triplet with a given sum in BST | Set 2
- Find all unique pairs of maximum and second maximum elements over all sub-arrays in O(NlogN)
- Python | Stack using Doubly Linked List

Given a stack with push(), pop(), empty() operations, delete middle of it without using any additional data structure. Input : Stack[] = [1, 2, 3,… Read More »

Given an expression exp of length n consisting of some brackets. The task is to print the bracket numbers when the expression is being parsed.… Read More »

Telephonic Round-1 A number of bad URLs are given (number could be huge-millions of them). Now user enters a URL, you need to identify whether… Read More »

Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1… Read More »

Prefix : An expression is called the prefix expression if the operator appears in the expression before the operands. Simply of the form (operator operand1… 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).… 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… 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 expression, find if it contains a redundant parenthesis or not. A set of parenthesis are redundant if same sub-expression is… 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… 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 »

Given a string str, we need to print reverse of individual words. Examples: Input : Hello World Output : olleH dlroW Input : Geeks for… Read More »

Deque also known as double eneded queue, as name suggests is a special kind of queue in which insertions and deletions can be done at… 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 »