Given an array arr[] consisting of N integers and a positive integer K, the task is to find the number of subarrays of size K… Read More

# Category Archives: Advanced Data Structure

There are some data structures that are supported by g++ compiler and are not a part of the C++ standard library. One of these is:… Read More

Given an array arr[] consisting of N strings and Q queries in form of two strings prefix and suffix, the task for each query is… 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

There are many ways of classifying algorithms and a few of them are shown below: Implementation Method Design Method Other Classifications Classification by Implementation Method:… Read More

Count triplets (i, j, k) in an array of distinct elements such that a[i] < a[j] > a[k] and i < j < k

Given an array arr[] consisting of N distinct integers, the task is to count the number of triplets (i, j, k) possible from the array… Read More

The find_by_order() is a built-in function of Ordered Set which is a Policy Based Data Structure in C++. Policy-based data structures are not part of… Read More

Given an array arr[] consisting of N non-negative integers and a 2D array queries[][] consisting of queries of the type {X, M}, the task for… Read More

Given a string S of length N and a 2D array of strings Q[][] consisting of M queries of the following type: Query(“U”, “I”, “X”):… Read More

Given an N-ary tree consisting of N nodes numbered from 1 to N rooted at node 1, the task is to assign values to each… Read More

Given an Array arr[] of positive integers of size n. We are required to perform following 3 queries on given array – 1) Given L… Read More

Given a string S and an array of strings arr[] of length N and M respectively, the task is to find the string from the… Read More

Given an array arr[] consisting of N integers and a 2D array Q[][] consisting of queries of the following two types: 1 L R: Print… Read More

Given two arrays apples[] and days[] representing the count of apples an apple tree produces and the number of days these apples are edible from… Read More

Given an array arr[] consisting of N 0s and a 2D array Q[][] consisting of queries of the following two types: 1 L R X:… Read More