Given an array arr[] of N integers, the task is to find the number of pairs of array elements (arr[i], arr[j]) such that the difference… Read More

# Tag Archives: HashTable

Given an array arr[] consisting of N integers, the task for each array element is to find the absolute difference between the count of distinct… Read More

Given a string S of N characters, the task is to calculate the total number of non-empty substrings such that at most one character occurs… Read More

Given two arrays arr1[] and arr2[] of pairs of the form {ID, value} of size N and M respectively and an integer target, the task… Read More

Given an array arr[] of length N and Q queries of 3 types (1, 2, 3) whose operations are as follows: Type 1: query has… Read More

Given an array arr[] consisting of N integers, the task is to find the minimum number of array elements that must be removed such that… Read More

Given an array arr[] consisting of N integers, the task is to find the maximum element with the minimum frequency. Examples: Input: arr[] = {2,… Read More

The task is to design a general Hash Table data structure with Collision case handled and that supports the Insert(), Find(), and Delete() functions. Examples:… Read More

Given an array arr[] consisting of N integers, the task is to split the array into the minimum number of disjoint groups, such that differences… Read More

Given an array arr[] consisting of N integers, the task is to partition the array into two subsets such that the count of unique elements… Read More

Given a Binary Tree consisting of N nodes, the task is to find the maximum width of the given tree where the maximum width is… Read More

Given two arrays W[] and L[] consisting of N positive integers, where W[i] is initially located at position i on an infinite number line. In… Read More

Given a sorted array arr[] consisting of N positive integers and an integer D, the task is to find the number of triplets (i, j,… Read More