Category Archives: Stack

Array: An Array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.… Read More
Given an array arr[] of size N and integer Y, the task is to find a minimum of all the differences between the maximum and… Read More
Given a valid parenthesis string S, the task is to find the weight of parenthesis based on the following conditions: Weight of “( )” is… Read More
Given string str, the task is to check if characters at the odd indexes of str form a palindrome string or not. If not then… Read More
Given a binary tree of N nodes, the task is to print level order traversal in a spiral form. In spiral form, nodes at the… Read More
Given a string htmlCode which is HTML code of a webpage, the task is to find the missing end tag in the HTML code. Examples:… Read More
Given an array arr[] of N integers and two numbers K and S, the task is to print all the subsquence of length K with… Read More
Given a string str, the task is to check if it is possible to split the given string into even length palindromic substrings. Examples:   Input: str… Read More
Given an array arr[] of positive and negative integers, the task is to print the array after the removal of adjacent array elements starting from… Read More
Given an array arr[], the task is to find the sum of decomposition value of the suffixes subarray. Decomposition Value: Decomposition value of a subarray… Read More
Given S stacks of length M, the task is to maximize the sum of elements at the top of each stack by popping at most… Read More
Given an array arr[] containing N integers, the task is to rearrange the array such that the odd indexed elements are in reverse order.Examples: Input:… Read More
Given a string representing infix notation. The task is to convert it to an expression tree.Expression Tree is a binary tree where the operands are… Read More
Given a queue Q containing N strings, the task is to restructure the queue to double its size such that the second half represents the… Read More