## Levelwise Alternating GCD and LCM of nodes in Segment Tree

A Levelwise GCD/LCM alternating segment tree is a segment tree, such that at every level the operations GCD and LCM alternate. In other words at… Read More »

- Shortest Path Faster Algorithm
- Count the number of words with given prefix using Trie
- Check if given words are present in a string
- Minimum Cost Graph
- Count number of increasing sub-sequences : O(NlogN)
- Design a data structure that supports insert, delete, getRandom in O(1) with duplicates
- Queries for elements having values within the range A to B in the given index range using Segment Tree
- Ackermann Function
- Design a Queue data structure to get minimum or maximum in O(1) time
- Paranthesis Theorem
- Dynamic Segment Trees : Online Queries for Range Sum with Point Updates
- Types of Tries
- XOR of elements in a given range with updates using Fenwick Tree
- Maximum CPU Load from the given list of jobs
- Sum and Maximum of elements in array from [L, R] before and after updates
- Build a segment tree for N-ary rooted tree
- Range Sum and Update in Array : Segment Tree using Stack
- Query to find the maximum and minimum weight between two nodes in the given tree using LCA.
- Find K-th smallest element in an array for multiple queries
- Counting Inversions using Ordered Set and GNU C++ PBDS
- Check if a Tree can be split into K equal connected components
- Binary Array Range Queries to find the minimum distance between two Zeros
- Count of elements in an Array whose set bits are in a multiple of K
- Static and Dynamic data structures in Java with Examples
- Array Range Queries to find the Maximum Armstrong number with updates
- Queries to search an element in an array and move it to front after every query
- Count of distinct colors in a subtree of a Colored Tree with given min frequency for Q queries
- Count of different groups using Graph
- Queries for the count of even digit sum elements in the given range using Segment Tree.
- Count all sub-strings with weight of characters atmost K

A Levelwise GCD/LCM alternating segment tree is a segment tree, such that at every level the operations GCD and LCM alternate. In other words at… Read More »

Given a binary tree where each node can have at most two child nodes, the task is to find the Euler tour of the binary… Read More »

Given an array arr[0 . . . n-1]. Find the maximum of elements from index l to r where 0 <= l <= r <=… Read More »

Prerequisite :Basic knowledge of STL and Sets Data structure. About ordered set Ordered set is a policy based data structure in g++ that keeps the… Read More »

Given N numbers and Q queries, each query consists of L and R. Task is to write a program which prints the count of numbers… Read More »

Given a rectangular matrix M[0…n-1][0…m-1], and queries are asked to find the sum / minimum / maximum on some sub-rectangles M[a…b][e…f], as well as queries… Read More »

Euler tour tree (ETT) is a method for representing a rooted tree as a number sequence. When traversing the tree using Depth for search(DFS), insert… Read More »

Given N pieces of chessboard all being ‘white’ and a number of queries Q. There are two types of queries : Update : Given indices… Read More »

Given an array of numbers of size N and Q queries. Each query or a range can be represented by L (LeftIndex) and R(RightIndex). Find… Read More »

Given an array of N integers, the task is to perform the following two queries: query(start, end) : Print the number of prime numbers in… Read More »

A Levelwise OR/XOR alternating segment tree is a segment tree, such that at every level the operations OR and XOR alternate. In other words at… Read More »

Given a number N, and Q queries of two types 1 and 2. Task is to write a code for the given query where, in… Read More »

Prerequisites: Disjoint Set Data Structure Set Unordered_Map Disjoint Set data structure is used to keeps track of a set of elements partitioned into a number… Read More »

AA trees are the variation of the red-black trees, a form of binary search tree. AA trees use the concept of levels to aid in… Read More »

Given an array of N(always a power of 2) elements and Q queries. Every Query consists of two elements index and value.. We need to… Read More »