Given two arrays A and B of sizes N and M respectively, the task is to calculate the XOR sum of bitwise ANDs of all… Read More

# Category Archives: Data Structures

A tree is non-linear and a hierarchical data structure consisting of a collection of nodes such that each node of the tree stores a value,… Read More

Given two integers N, K, and an array, arr[] of size N, containing an equal number of even and odd elements, and also given that… Read More

Given an N-array Tree consisting of N nodes and an integer K, the task is to find the Kth largest element in the given N-ary… Read More

Queries to calculate average of an array after removing K smallest and largest elements with updates

Given two positive integers N and K, initialize an empty array arr[] and Q number of queries of the following two types: addInteger(x): Insert element… Read More

Given an array arr[] consisting of N positive integers, the task is to find the sum of Bitwise AND of all possible triplets (arr[i], arr[j],… Read More

Given an array arr[] consisting of N integers, the task is to find the number of pairs, where i ≤ j, such that the sum… Read More

Given a string S consisting of N lowercase characters, the task is to modify the given string such that no subsequence of length two repeats… Read More

Given a string S consisting of N characters, the task is to check if the given string S is IPv4 or IPv6 or Invalid. If… Read More

Given an array arr[] consisting of N pairs and a positive integer M, the task is to maximize the average of the ratio of the… Read More

Given a numeric string S consisting of N digits and a positive integer K, the task is to check if the given string can be… Read More

Given an array A[] of size N, and two numbers K and D, the task is to calculate the maximum subset-sum divisible by D possible… Read More

Given a Binary Tree consisting of N nodes, the task is to first compress the tree diagonally to get a list of integers and then,… Read More

Given a circular singly linked list, the task is to print the next greater element for each node in the linked list. If there is… Read More