## Total number of possible Binary Search Trees using Catalan Number

Given an integer N, the task is to count the number of possible Binary Search Trees with N keys. Examples: Input: N = 2 Output:… 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 integer N, the task is to count the number of possible Binary Search Trees with N keys. Examples: Input: N = 2 Output:… Read More »

Given a Binary Search Tree, the task is to find the node with maximum value. Examples: Input: Output: 22 Recommended: Please try your approach on… Read More »

Given an integer array ‘arr’ of length N and an integer ‘k’, select some non-overlapping subarrays such that each sub-array if of length at most… Read More »

Given two Binary Search Trees(BST), print the elements of both BSTs in sorted form. Note: Both the BSTs will not have any common element. Examples:… Read More »

Given an array arr[] of N integers and an integer K. The task is to find the number of ways to select one or more… Read More »

Given an array ‘arr’ consisting of integers, the task is to find the non-empty subset such that its sum is closest to zero i.e. absolute… Read More »

Given three arrays A[], B[] and C[] of same size N. The task is to minimize the sum after choosing N elements from these array… Read More »

Given an integer array arr[] of length N and an integer K, the task is to select some non-overlapping sub-arrays such that each sub-array is… Read More »

Given a maze which is a N * N grid grid[][]. Every cell of the maze contains either the number 1, 2 or 3 which… Read More »

Given an array with positive integers. The task is to find the factorial of all the array elements. Note: As the numbers would be very… Read More »

Given three integer n, h and p where n is the number of topics, h is the time left (in hours) and p is the… Read More »

Question 1: What is the asymptotic boundary of T(n)? θ( n*log(n) ) θ( n2 ) θ( n ) θ( n*log2(n) ) θ( n2*log2(n) ) Answer:… Read More »

The value of Exponential function can be calculated using Taylor Series. = 1 + x/1! + /2! + /3! + …… To find its value… Read More »

Question 1: What is the complexity of T(n)? Θ( 1⁄n ) Θ( 1⁄n2 ) Θ( 1 ) Θ( ln( n ) ) Answer: 3 Explanation:… Read More »

Given an array ‘arr’ consisting of integers, the task is to find the number of subsets such that their sum is equal to zero. Empty… Read More »