# Category Archives: Stack

## Calculate weight of parenthesis based on the given conditions

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 »

## Check given string is oddly palindrome or not | Set 2

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 »

## Level order traversal in spiral form using stack and multimap

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 »

## Find the missing end tag in the given HTML Code

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 »

## Unique subsequences of length K with given sum

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 »

## Check if a string can be split into even length palindromic substrings

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:… Read More »

## Maximize removal of adjacent array elements based on their absolute value

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 »

## Sum of decomposition values of all suffixes of an Array

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 »

## Real-time application of Data Structures

A data structure is a particular way of organizing data in a computer so that it can be used effectively. In this article, the real-time… Read More »

## Maximize sum of topmost elements of S stacks by popping at most N elements

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 »

## Reverse the elements only at odd positions in the given Array

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:… Read More »

## Program to convert Infix notation to Expression Tree

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… Read More »

## Append the elements of queue in mirror-inverse order

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 »

## Minimum operation required to make a balanced sequence

A balanced sequence is defined as a string in which for every opening bracket there are 2 continuous closing brackets. Thus {}}, {{}}}}, {{}}{}}}} are… Read More »

## C/C++ program for calling main() in main()

Given a number N, the task is to write C/C++ program to print the number from N to 1 by calling the main() function using… Read More »