## Number of subsequences with zero sum

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 »

- Print the last k nodes of the linked list in reverse order
- Check if a word exists in a grid or not
- Print all permutations of a string in Java
- Recursive program to print all subsets with given sum
- Java Program to print distinct permutations of a string
- Count ways to reach a score using 1 and 2 with no consecutive 2s
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Printing all subsets of {1,2,3,...n} without using array or loop
- Double Knapsack | Dynamic Programming
- Print all paths from top left to bottom right in a matrix with four moves allowed
- Print all subsequences of a string using ArrayList
- Longest Ordered Subsequence of Vowels
- Algorithms | Recurrences | Set 1
- Find the value of ln(N!) using Recursion
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Split the array into equal sum parts according to given conditions
- Number of Binary Strings of length N with K adjacent Set Bits
- Generate all the binary strings of N bits
- Recursive Program for Binary to Decimal
- Sum of the series 1^1 + 2^2 + 3^3 + ..... + n^n using recursion
- Number of balanced bracket expressions that can be formed from a string
- Programs for printing pyramid patterns using recursion
- Print Stack Elements from Bottom to Top
- Count Unary Numbers in a Range
- Number of Paths of Weight W in a K-ary tree
- Recursive program to insert a star between pair of identical characters
- Minimum swaps to group similar characters side by side?
- Number of blocks in a chessboard a knight can move to in exactly k moves

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 »

Given a tree with N nodes, and two integers K and V. The task is to find the Kth node in the DFS traversal of… Read More »

Given a graph, the task is to detect a cycle in the graph using degrees of the nodes in the graph and print all the… Read More »

Given a number N. The task is to find the number of integers from 1 to n which contains digits 0’s and 1’s only. Examples:… Read More »

Given a N x N matrix mat[][] consisting of non-negative integers, the task is to find the number of ways to reach a given score… Read More »

Given two integers n and m and a and b, in a single operation n can be multiplied by either a or b. The task… Read More »

This article is aimed at giving a recursive implementation for pattern printing. Simple triangle pattern: C++ filter_none edit close play_arrow link brightness_4 code // C++… Read More »

Given a tree having every node’s value as either 0 or 1, the task is to find whether the given binary tree contains any sub-tree… Read More »

Given two integers A and B, the task is to calculate 22A % B. Examples: Input: A = 3, B = 5 Output: 1 223… Read More »

Given three integers X, N and M. The task is to find XXX…(N times) % M where X can be any digitfrom the range [1,… Read More »

Given two integers N and K, the task is to count the number of ways to make a binary string of length N such that… Read More »

Given a positive integer number N. The task is to generate all the binary strings of N bits. These binary strings should be in ascending… Read More »

Given an array arr[] and an integer K, the task is to find out the minimum product of a subsequence where adjacent elements of the… Read More »