The task is to implement some important functions of stack like pop(), push(), display(), topElement(), isEmpty(), isFull() using class template in C++. Stack is a… Read More
Category Archives: Stack
Given a 2D array grid[][] of dimension N * M, the task is to perform the Depth – First Search traversal on the given 2D… Read More
Given an array arr[] consisting of N strings, the task is to find the total sum of the array brr[] (initially empty) constructed by performing… Read More
Given a Binary Tree consisting only ‘(‘ and ‘)’ a level is considered to be balanced if the nodes of the level having parenthesis are… Read More
Given a binary tree, the task is to print the inorder traversal of the modified tree obtained after shifting all the nodes of the given… Read More
Given string str of length N, consisting of pairs of balanced parentheses, the task is to calculate the score of the given string based on… Read More
Given a string S of length N, the task is to find the lexicographically smallest K-length subsequence from the string S (where K < N). … Read More
Given a binary string str, the task is to check if the string can be emptied by removing all subsequences of the form “10” Examples:… Read More
Given a binary tree, the task is to print all the nodes of the binary tree in Pre-order, Post-order, and In-order iteratively using only one… Read More
Given a string S consisting of characters ‘(‘, ‘)’, ‘[‘, ‘]’, ‘{‘, ‘}’, the task is to remove all balanced bracket subsequences from the string… Read More
Given an array arr[] of size N and an integer K, the task is to print all possible ways to split the given array into… Read More
Given a string str consisting of pairs of balanced parentheses, the task is to calculate the score of the given string based on the following… Read More
Given an array arr[] of size N, the task to reverse the array using Stack. Examples: Input: arr[] = { 10, 20, 30, 40, 50… Read More
Given a string S consisting of ‘(‘, ‘)’, ‘[‘ and ‘]’, the task is to find the minimum count of remaining characters in the string… Read More
Given a string S of size N consisting of ‘(‘, ‘)’, and ‘$’, the task is to check whether the given string can be converted… Read More

