## Maximum sum of pairs with specific difference

The problem “Maximum sum of pairs with specific difference” states that you are given an array of integers and an integer K. Then we are asked to find out the maximum sum of independent pairs. We can pair two integers if they have an absolute difference of less than K. …

## Count of index pairs with equal elements in an array

Suppose, we have given an integer array. The problem “Count of index pairs with equal elements in an array” asks to find out the no of pair of indices (i,j) in such a way that arr[i]=arr[j] and i is not equal to j. Example arr[] = {2,3,1,2,3,1,4} 3 Explanation Pairs …

## Construct Binary Tree from given Parent Array representation

The problem “Construct Binary Tree from given Parent Array representation” states that you are given an array. This input array represents a binary tree. Now you need to construct a binary tree on the basis of this input array. The array stores the index of parent node at each index. …

## Given a binary tree, how do you remove all the half nodes?

The problem “Given a binary tree, how do you remove all the half nodes?” states that you are given a binary tree. Now you need to remove the half nodes. A half node is defined as a node in the tree that has only a single child. Either it is …

## Find elements which are present in first array and not in second

The problem “Find elements which are present in first array and not in second” states that you are given two arrays. Arrays consist of all the integers. You have to find out the numbers which will not be present in the second array but present in the first array. Example …

## Boundary Traversal of binary tree

Problem Statement The problem “Boundary Traversal of binary tree” states that you are given a binary tree. Now you need to print the boundary view of a binary tree. Here boundary traversal means that all the nodes are shown as the boundary of the tree. The nodes are seen from …

## How to check if two given sets are disjoint?

The problem “How to check if two given sets are disjoint?” states that suppose you are given two sets in the form of array say set1[] and set2[]. Your task is to find out whether the two sets are Disjoint Sets or not. Example inputSet1[] = {1, 15, 8, 9, …

## Check if a given array contains duplicate elements within k distance from each other

The problem “Check if a given array contains duplicate elements within k distance from each other” states that we have to check for duplicates in given unordered array within the range of k. Here the value of k is smaller than the given array. Examples K = 3   arr[] = …

## Print Right View of a Binary Tree

Problem Statement The problem “Print Right View of a Binary Tree” states that you are given a binary tree. Now you need to find the right view of this tree. Here, right view of the binary tree means to print the sequence as the tree looks when looked from the …

## Write a function to get the intersection point of two Linked Lists

Problem Statement The problem “Write a function to get the intersection point of two Linked Lists” states that you are given two linked lists. But they are not independent linked lists. They are connected at some point. Now you need to find this point of intersection of these two lists. …