Skip to content

Tag Archives: Segment-Tree

A segment tree is a data structure used to effectively query and update ranges of array members. It’s typically implemented as a binary tree, with… Read More
Compressed trees are a data structure that allows efficient queries and updates on a tree. The basic idea is to replace each subtree with a… Read More
Dynamic Segment Trees with Poly Hash Tables is a data structure that combines the benefits of both dynamic segment trees and hash tables to efficiently… Read More
Given an array arr[] of length N consisting of a positive integer, the task is to complete the Q queries and print values accordingly which… Read More
Segment Tree A segment tree is a data structure that can be used to efficiently store and query information about ranges in an array. It… Read More
Given an array arr[] consisting of N distinct integers and a 2d array Q[][3] consisting of M queries of the 2 types whose operations are… Read More
What is Segment Tree? A Segment Tree is a data structure that stores information about a range of elements in its nodes. It also allows… Read More
First, let us understand why we need it prior to landing on the introduction so as to get why this concept was introduced. Suppose we… Read More
Given an array consisting of N positive integers, and Q queries where each query is one of the following types: 1 l r – Requires… Read More
Given an array arr[ ] which contains N positive integers and an integer K and a vector of queries Q . Two types of queries… Read More
Given an array arr[] of size N where each element denotes a pair in the form (price, weight) denoting the price and weight of each… Read More

Start Your Coding Journey Now!