Print path between any two nodes in a Binary Tree | Set 2
Given a Binary Tree of distinct nodes and a pair of nodes. The task is to find and print the path between the two given… Read More »
Given a Binary Tree of distinct nodes and a pair of nodes. The task is to find and print the path between the two given… Read More »
Given a binary string str of length N, the task is to find the count of subsequences of str which are divisible by 2. Leading… Read More »
Given an integer N and an infinite number of Full Binary Trees of different depths, the task is to choose minimum number of trees such… Read More »
Given an array seats[] where seat[i] is the number of vacant seats in the ith row in a stadium for a cricket match. There are… Read More »
Given two strings X and Y containing lower-case alphabets, the task is to check whether any permutation of string X exists in Y as its… Read More »
Given an array arr[] of length N, the task is to find the largest number dividing the maximum number of elements from the array. Examples:… Read More »
Given a knapsack with capacity C and two arrays w[] and val[] representing the weights and values of N distinct items, the task is to… Read More »
Given an array arr[] of N integers, the task is to remove all the prime numbers. Examples: Input: arr[] = {4, 6, 5, 3, 8,… Read More »
Given a string str that consists of lower case English letters and brackets. The task is to reverse the substrings in each pair of matching… Read More »
Given an array arr[] of N elements, the task is to remove one element from the array such that the OR value of the array… Read More »
B-Tree : B-Tree is known as self-balancing tree as its nodes are sorted in inorder traversal. Unlike binary tree, in B-tree, a node can have… Read More »
Given a tree with N nodes, the task is to find the sum of lengths of all the paths. Path length for two nodes in… Read More »
Given an array arr[] of size N and the task is to answer Q queries of the following types: 1 X 0: Append X at… Read More »
Given an integer K and an array height[] where height[i] denotes the height of the ith tree in a forest. The task is to make… Read More »
Given a tree with N nodes and N – 1 edges. Each edge of the tree is labeled by a string of lowercase english alphabets.… Read More »