Given an array arr[] consisting of N integers, the task is to find the maximum sum of an array formed by decreasing array elements by… Read More

# Category Archives: Advanced Data Structure

Given a string str of length N, and Q queries of the following two types: (1 L R K): Find the Kth greatest character (non-distinct)… Read More

Given a string str, consisting of lowercase English alphabets, the task is to calculate the sum of indices(1-based indexing) of the characters removed to obtain… Read More

Prerequisite: Trie | (Insert and Search) Given an array of strings words[] and a partial string str, the task is to find the strings of… Read More

Given a string S of Size N. Initially, the value of count is 0. The task is to find the value of count after N… Read More

Given an array arr[] consisting of N integers and queries Q[][] of the form {L, R} where 0 ≤ L < R ≤ N –… Read More

Given an array arr[] consisting of N integers, consisting only of 0‘s initially and queries Q[][] of the form {L, R, C}, the task for… Read More

Given a boolean matrix mat[][] consisting of N rows and M columns, initially filled with 0‘s(empty cells), an integer K and queries Q[][] of the… Read More

Given an undirected graph consisting of N vertices and M edges and queries Q[][] of the type {X, Y}, the task is to check if… Read More

Given an array A[ ] consisting of non-negative integers and a matrix Q[ ][ ] consisting of queries of the following two types: (1, l,… Read More

Given an N-ary Tree rooted at 1, and an array val[] consisting of weights assigned to every node, and a matrix Q[][], consisting of queries… Read More

Given an array A[ ] consisting of N distinct integers, the task is to find the number of elements which are strictly greater than all… Read More

Given an array arr[] of the size of N followed by an array of Q queries, of the following two types: Query Type 1: Given… Read More

In this article, we will generate test cases such that given set edges form a Tree. Below are the two conditions of the Tree: It… Read More

Given an array arr[] consisting of integers and queries Q of the form (L, R), the task is to check whether any non-repeating element is… Read More