Binary Indexed Tree - Medium Articles
Given an array A of N integers and number of queries Q. You have to answer two types of queries.  Update [l, r] – for… Read More
Prerequisites: Fenwick Tree (Binary Indexed Tree)Given an array of N numbers, and a number of queries where each query will contain three numbers(l, r and… 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 A of N integers. You have to answer two types of queries : 1. Update [l, r] – for every i in… Read More
Given an array of size n. Find the maximum sum of an increasing subsequence.Examples:  Input : arr[] = { 1, 20, 4, 2, 5 }… Read More
Given an array ‘a[]’ and number of queries q. Each query can be represented by l, r, x. Your task is to print the number… Read More
Prerequisites: BIT, DFS Given a rooted tree T, with ‘n’ nodes, each node has a color denoted by the array color[](color[i] denotes the color of… Read More
Pre-requisite: BIT(Binary Indexed Tree or Fenwick Tree), 2D BITGiven a 2D plane, respond to Q queries, each of the following type:  Insert x y –… Read More
Given an array arr[] of size n. Three elements arr[i], arr[j] and arr[k] form an inversion of size 3 if a[i] > a[j] >a[k] and… Read More
  In this post, we will discuss Important top 10 algorithms and data structures for competitive coding. Topics :  Graph algorithms Dynamic programming Searching and… Read More
Let us consider the following problem to understand Binary Indexed Tree.We have an array arr[0 . . . n-1]. We would like to 1 Compute the… Read More