27 Segment Tree or BIT

开刷四年了,终于下定决心学起了BIT和segment tree。

简单介绍:

Binary Index Tree (Fenwick Tree)

Segment Tree

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

L439 Segment Tree Build II

L248 Count of Smaller Number

L247 Segment Tree Query II

207 Interval Sum II

206 Interval Sum

L205 Interval Minimum Number

L203 Segment Tree Modify

L202 Segment Tree Query

L201 Segment Tree Build

--------------下面的可以用线段树或者Binary Index Tree-----------

L249 Count of Smaller Number Before itself

315 Count of Smaller Numbers After Self

308 Range Sum Query 2D - Mutable

307 Range Sum Query - Mutable

493 Reverse Pairs -- 可以用merge sort添

1649 Create Sorted Array through Instructions -- 也可以merge sort

other related:

303 Range Sum Query - immutable -- prefixSum

304 Range Sum Query 2D - immutable -- prefix Sum

Last updated