# Category Archives: Advanced Data Structure

## Queries for count of array elements with values in given range with updates

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

## Median of sliding window in an array | Set 2

Prerequisites: Policy based data structure, Sliding window technique. Given an array of integer arr[] and an integer K, the task is to find the median… Read More »

## Maximum distance between two points in coordinate plane using Rotating Caliper’s Method

Prerequisites: Graham Scan’s Convex Hull, Orientation. Given a set of N points in a coordinates plane, the task is to find the maximum distance between… Read More »

## String Range Queries to count number of distinct characters with updates

Given a string S of length N, and Q queries of the following type: Type 1: 1 i X Update the i-th character of the… Read More »

## Minimum cost of reducing Array by merging any adjacent elements repetitively

Given an array arr[] of N numbers. We can merge two adjacent numbers into one and the cost of merging the two numbers is equal… Read More »

## Finding shortest path between any two nodes using Floyd Warshall Algorithm

Given a graph and two nodes u and v, the task is to print the shortest path between u and v using the Floyd Warshall… Read More »

## Isomorphism in N-ary Trees

Given two N-ary trees having M nodes each. Also, given their edges and their roots respectively. The task is to check if they are isomorphic… Read More »

## Sum of minimum element at each depth of a given non cyclic graph

Given a non-cyclic graph having V nodes and E edges and a source node S, the task is to calculate the sum of the minimum… Read More »

## Count of distinct numbers in an Array in a range for Online Queries using Merge Sort Tree

Given an array arr[] of size N and Q queries of the form [L, R], the task is to find the number of distinct values… Read More »

## Binary Space Partitioning

Binary Space Partitioning is implemented for recursively subdividing a space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise… Read More »

## How to implement text Auto-complete feature using Ternary Search Tree

Given a set of strings S and a string patt the task is to autocomplete the string patt to strings from S that have patt… Read More »

## Number of times an array can be partitioned repetitively into two subarrays with equal sum

Given an array arr[] of size N, the task is to find the number of times the array can be partitioned repetitively into two subarrays… Read More »

## Check if it is possible to reach to the index with value K when start index is given

Given an array arr[] of N positive integers and two positive integers S and K, the task is to reach the position of the array… Read More »

## Number of ways to change the Array such that largest element is LCM of array

Given an array arr[], the task is to count the number of the unique arrays can be formed by updating the elements of the given… Read More »

## Find array sum using Bitwise OR after splitting given array in two halves after K circular shifts

Given an array A[] of length N, where N is an even number, the task is to answer Q independent queries where each query consists… Read More »