## Sum of minimum elements of all subarrays

Given an array A of n integers. The task is to find the sum of minimum of all possible (contiguous) subarray of A. Examples: Input:… Read More »

- Stack of Pair in C++ STL with Examples
- C/C++ program for calling main() in main()
- Real-time application of Data Structures
- Maximize sum of topmost elements of S stacks by popping at most N elements
- Range Sum and Update in Array : Segment Tree using Stack
- Maximum XOR value of maximum and second maximum element among all possible subarrays
- Append the elements of queue in mirror-inverse order
- Minimum steps required to make an array decreasing
- Static and Dynamic data structures in Java with Examples
- Generate Complete Binary Tree in such a way that sum of non-leaf nodes is minimum
- Largest row-wise and column-wise sorted sub-matrix
- Program to convert Infix notation to Expression Tree
- Sort array such that absolute difference of adjacent elements is in increasing order
- Difference between Stack and Array
- Print all K-sum levels in a Binary Tree
- Parsing String of symbols to Expression
- Maximum of XOR of first and second maximum of all subarrays
- Output of Java Programs | Set 55 (Java Collections Framework)
- Reverse the elements only at odd positions in the given Array
- Find number of subarrays ending with arr[i] where arr[i] is the minimum element of that subarray
- Find the number of unique pairs satisfying given conditions
- Minimum operation required to make a balanced sequence
- Minimum integer that can be obtained by swapping adjacent digits of different parity
- Stack machine in Computer Organisation
- Sum of decomposition values of all suffixes of an Array
- Maximize removal of adjacent array elements based on their absolute value

Given an array A of n integers. The task is to find the sum of minimum of all possible (contiguous) subarray of A. Examples: Input:… Read More »

Given a source stack, copy the contents of the source stack to destination stack maintaining the same order without using extra space. Examples: Input :… Read More »

Implement a stack using single linked list concept. all the single linked list operations perform based on Stack operations LIFO(last in first out) and with… Read More »

Given a string ‘str’ and an integer ‘k’, the task is to reduce the string by applying the following operation: Choose a group of ‘k’… Read More »

Given postorder traversal of a binary search tree, construct the BST. For example, 1. If the given traversal is {1, 7, 5, 50, 40, 10},… Read More »

Given a linked list and a number N. Find the product of last n nodes of the linked list. Constraints : 0 <= N <=… Read More »

Prerequisite: Stack, Hashing Given a stack of N numbers and an array of numbers. Count the numbers of pop operations required to get each element… Read More »

Given a stack of integers. The task is to design a special stack such that maximum element can be found in O(1) time and O(1)… Read More »

Given a stack of integers, write a function pairWiseSorted() that checks whether numbers in the stack are pairwise sorted or not. The pairs must be… Read More »

Given a Queue of integers. The task is to check if consecutive elements in the queue are pairwise consecutive. Examples: Input : 1 2 5… Read More »

Given an array, print the Next Greater Element (NGE) for every element. The Next greater Element for an element x is the first greater element… Read More »

Prerequisites – Recursion, Backtracking and Stack Data Structure. A Maze is given as N*M binary matrix of blocks and there is a rat initially at… Read More »

Prerequisites – FIFO (First-In-First-Out) approach in Programming, FIFO vs LIFO approach in Programming LIFO is an abbreviation for last in, first out. It is a… Read More »

Given Inorder and Postorder traversals of a binary tree, print Preorder traversal. Example: Input: Postorder traversal post[] = {4, 5, 2, 6, 3, 1} Inorder… Read More »

Approved Offer. Bank Of America has visited our college for on campus recruitment . The recruitment consisted of 4 Rounds in total. The recruitment was… Read More »