## Sum of maximum of all subarrays | Divide and Conquer

Given an array arr[] of length N, the task is to find the sum of the maximum elements of every possible sub-array of the array.… Read More »

- Print all permutations of a string in Java
- Check if a word exists in a grid or not
- Print the last k nodes of the linked list in reverse order | Recursive approach
- Java Program to print distinct permutations of a string
- Recursive program to print all subsets with given sum
- Double Knapsack | Dynamic Programming
- Generate all the binary strings of N bits
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Sum of the series 1^1 + 2^2 + 3^3 + ..... + n^n using recursion
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Print all subsequences of a string using ArrayList
- Print all paths from top left to bottom right in a matrix with four moves allowed
- Find the value of ln(N!) using Recursion
- Programs for printing pyramid patterns using recursion
- Detect cycle in the graph using degrees of nodes of graph
- Longest Ordered Subsequence of Vowels
- Print Stack Elements from Bottom to Top
- Split the array into equal sum parts according to given conditions
- Algorithms | Recurrences | Set 1
- Count number of ways to reach a given score in a Matrix
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Minimum number of cubes whose sum equals to given number N
- Recursive Program for Binary to Decimal
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Print path from root to all nodes in a Complete Binary Tree
- Maximum sum of non-overlapping subarrays of length atmost K
- Modify contents of Linked List - Recursive approach
- Recursive program to insert a star between pair of identical characters
- Recursive program to print all numbers less than N which consist of digits 1 or 3 only

Given an array arr[] of length N, the task is to find the sum of the maximum elements of every possible sub-array of the array.… Read More »

Given an array arr[] of N integers, you can select some indexes such that every selected index has exactly one other selected index adjacent to… Read More »

Given a positive integer n, the task is to generate all possible unique ways to represent n as sum of positive integers. Examples: Input: 4… Read More »

Given an N * N matrix arr[][] consisting of non-negative integers, the task is to find the number of ways to reach arr[N – 1][N… Read More »

Given an N-ary tree and an array val[] which stores the values associated with all the nodes. Also given are a leaf node X and… Read More »

Given a complete binary tree, the task is to find the sum of mirror image nodes in an inorder way i.e. find the inorder traversal… Read More »

Given Preorder, Inorder and Postorder traversals of some tree. The task is to check if they all are of the same tree. Examples: Input :… Read More »

Given an n-ary tree and Q queries where each query consists of an integer u which denotes a node. The task is to print the… Read More »

Given an integer n, the task is to find the minimum number of cubes whose sum equals to N. Examples: Input: N = 496 Output:… Read More »

Given a number N. Add one to the number in the first step and if the number has trailing zeros, remove all the trailing zeros… Read More »

Given a tree, and the weights of all the nodes and an integer x, the task is to find a node i such that weight[i]… Read More »

Given an integer N > 0, the task is to find the maximum product of digits among numbers less than or equal to N. Examples:… Read More »

Given an array arr[] of N integers. The task is to count the number of sub-sequences whose sum is 0. Examples: Input: arr[] = {-1,… Read More »

Given a Tree with N nodes, the task is to find a triplet of nodes (a, b, c) such that the number of nodes covered… Read More »

Given a number N which is the total number of nodes in a complete binary tree where nodes are number from 1 to N sequentially… Read More »