## Euler tour of Binary Tree

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 »

- Sort the array of strings according to alphabetical order defined by another string
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Number of subarrays have bitwise OR >= K
- Count of words that are present in all the given sentences
- Range Sum Queries and Update with Square Root
- Count of strings whose prefix match with the given string to a given length k
- Given an array and two integers l and r, find the kth largest element in the range [l, r]
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
- Range and Update Sum Queries with Factorial
- Range Queries to Find number of sub-arrays with a given xor
- Lazy Propagation in Segment Tree | Set 2
- Program to implement Run Length Encoding using Linked Lists
- Persistent Trie | Set 1 (Introduction)
- Queries for Composite numbers in subarray (With Point Updates)
- Find a pair from the given array with maximum nCr value
- Find triplet such that number of nodes connecting these triplets is maximum
- Queries to update a given index and find gcd in range
- B-Tree Insert without aggressive splitting
- Introduction to R-tree
- Arrange array elements such that last digit of an element is equal to first digit of the next element
- Find the number of different numbers in the array after applying the given operation q times
- Index of kth set bit in a binary array with update queries

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 »

Given a bracket sequence or in other words a string S of length n, consisting of characters ‘(‘ and ‘)’. Find length of the maximum… Read More »