This category is for logical grouping only. It needn’t to be added directly. Instead, the sub-categories should be added.

## Check if two nodes are in same subtree of the root node

Given a Binary Tree with distinct nodes. Given two nodes node1 and node2, check if the two nodes lies in the same subtree of the… Read More »

## Double ended priority queue

A double ended priority queue supports operations of both max heap (a max priority queue) and min heap (a min priority queue). The following operations… Read More »

## XOR of path between any two nodes in a Binary Tree

Given a binary tree with distinct nodes and a pair of two nodes. The task is to find the XOR of all of the nodes… Read More »

## Program to calculate Bitonicity of an Array

Given an array of integers. The task is to find the Bitonicity of the given array. The Bitonicity of an array arr[] can be defined… Read More »

## Count distinct pairs from two arrays having same sum of digits

Given two arrays arr1[] and arr2[]. The task is to find the total number of distinct pairs(formed by picking 1 element from arr1 and one… Read More »

## Search a node in Binary Tree

Given a Binary Node and a node. The task is to search and check if the given node exits in the binary tree or not.… Read More »

## Find the missing elements from 1 to M in given N ranges | Set-2

Given an integer and ranges (e.g. [a, b]) which are intersecting and overlapping. The task is to find all the number within the range that… Read More »

## Print all pairs in an unsorted array with equal sum

Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum. Note: Print the result in… Read More »

## Count pairs from two arrays whose modulo operation yields K

Given an integer and two arrays and , the task is to count the total pairs (formed after choosing an element from and another from… Read More »

## Check whether count of distinct characters in a string is Prime or not

Given a string of lowercase English alphabets. The task is to check if the count of distinct characters in the string is prime or not.… Read More »

## Find a palindromic string B such that given String A is a subsequense of B

Given a string . Find a string , where B is a palindrome and A is a subsequence of B. A subsequence of a string… Read More »

## Largest sub-array whose all elements are perfect squares

Given an array of integer elements, the task is to find the length of the largest sub-array of such that all the elements of the… Read More »

## Check whether the frequencies of all the characters in a string are prime or not

Given a string , the task is to check if the frequencies of all the characters of the string are prime or not. If all… Read More »

## Find the index of the left pointer after possible moves in the array

Given an array of size . Move two pointers, one from the left side and one from the right side of the array, a pointer… Read More »

## Generate random String of given size in Java

Given a size as n, The task is to generate a random alphanumeric String of this size. Below are various ways to generate random alphanumeric… Read More »