## Count occurrences of a substring recursively

Given two strings str1 and str2, the task is to count the number of times “str2” occurs in “str1” using recursion. Examples: Input : str1… Read More »

- Recursively Reversing a linked list (A simple implementation)
- Modular exponentiation (Recursive)
- Check if a word exists in a grid or not
- Count ways to reach a score using 1 and 2 with no consecutive 2s
- Program to check if an array is palindrome or not using Recursion
- Reduce a number to 1 by performing given operations
- Water Jug Problem using Memoization
- Generating subarrays using recursion
- Recursive program to print all subsets with given sum
- Count all possible position that can be reached by Modified Knight
- Printing all subsets of {1,2,3,...n} without using array or loop
- Find Nth term (A matrix exponentiation example)
- Number of Binary Strings of length N with K adjacent Set Bits
- Print all the combinations of a string in lexicographical order
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Generating all possible Subsequences using Recursion
- Longest Ordered Subsequence of Vowels
- Number of handshakes such that a person shakes hands only once
- Maximum length of segments of 0's and 1's
- Count Unary Numbers in a Range
- Check whether the two Binary Search Trees are Identical or Not
- Number of balanced bracket expressions that can be formed from a string
- Check if item can be measured using a scale and some weights
- Print all subsequences of a string using ArrayList
- Product of 2 numbers using recursion | Set 2
- Java 8 | Arrays parallelSort() method with Examples
- Print all paths from top left to bottom right in a matrix with four moves allowed
- Number of Paths of Weight W in a K-ary tree
- Recursive program to insert a star between pair of identical characters

Given two strings str1 and str2, the task is to count the number of times “str2” occurs in “str1” using recursion. Examples: Input : str1… Read More »

Given a Binary tree and a number N, write a program to find the N-th node in the Postorder traversal of the given Binary tree.… Read More »

Given a binary tree, change the value in each node to sum of all the values in the nodes in the right subtree including its… Read More »

Given a set represented as string, write a recursive code to print all subsets of it. The subsets can be printed in any order. Examples:… Read More »

Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, ”}”, ”(“, ”)”, ”[“, ”]” are correct… Read More »

Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater… Read More »

Given a Binary Tree having positive and negative nodes, the task is to find maximum product level in it. Examples: Input : 4 / \… Read More »

Given a coordinate (x, y) on a 2D plane. We have to reach (x, y) from the current position which is at origin i.e (0,… Read More »

A 10 x 10 Crossword grid is provided, along with a set of words (or names of places) which need to be filled into the… Read More »

Given a string, write a recursive program to reverse it. Recommended: Please try your approach on {IDE} first, before moving on to the solution. Method… Read More »

Prerequisite: Merge Sort for Linked Lists Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes… Read More »

Given a 3 x n board, find the number of ways to fill it with 2 x 1 dominoes. Example 1 Following are all the… Read More »

Given an array and two numbers M and K. We need to find sum of max M subarrays of size K (non-overlapping) in the array.… Read More »

Given a rectangular matrix M[0…n-1][0…m-1], and queries are asked to find the sum / minimum / maximum on some sub-rectangles M[a…b][e…f], as well as queries… Read More »

Write a removeDuplicates() function which takes a list sorted in non-decreasing order and deletes any duplicate nodes from the list. The list should only be… Read More »